HTTP Origin header not matching the base_url.

anilperumandlaanilperumandla Member

Wedsite owner getting below error related to revrse proxy header


below is te aFLEX rule which we had added on on A10, do we required any addition rules to this work ??

X-Forward ??

========================================

when HTTP_REQUEST {

  set URI [string tolower [HTTP::uri]]

  switch -glob $URI {


  default {

        HTTP::header replace Host "openstreetmap-web.apps.prod.ocp.mms.local"

        pool POOL_openstreetmap_prod_ocp

 }

}

}

========================================

below is

Tagged:

Comments

  • john_allenjohn_allen Member, A10ers ✭✭

    There are two ways to fix this, depending on your Web Server. Some Web Servers can be configured to ignore this error, or configured with the changed Host field as valid. The aFleX way to fix this would be to also do an 'HTTP::header replace Origin "openstreetmap-web.apps.prod.ocp.mms.local"' at the same time you are changing the Host header.

  • Thanks @john_allen for your reply. You mean based on your comment it should re applied on a10 like below ?

    when HTTP_REQUEST {


     set URI [string tolower [HTTP::uri]]


     switch -glob $URI {

     default {


        HTTP::header replace Orgin "openstreetmap-web.apps.prod.ocp.mms.local"


        pool POOL_openstreetmap_prod_ocp


     }


    }


    }

  • john_allenjohn_allen Member, A10ers ✭✭
    edited May 2023

    Yes, so your 'default' block should now look like this:

    default {

            HTTP::header replace Host "openstreetmap-web.apps.prod.ocp.mms.local"

    HTTP::header replace Orgin "openstreetmap-web.apps.prod.ocp.mms.local"

            pool POOL_openstreetmap_prod_ocp

     }

  • @john_allen thanks for your reply but still we are seing same error :(

    I had applied below rule

    when HTTP_REQUEST {

     set URI [string tolower [HTTP::uri]]

    switch -glob $URI {

     default {


         HTTP::header replace Host "openstreetmap-web.apps.prod.ocp.mms.local"

    HTTP::header replace Orgin "openstreetmap-web.apps.prod.ocp.mms.local"


        pool POOL_openstreetmap_prod_ocp

     }

    }

    }


    Error:

    W, [2023-05-15T09:24:06.028812 #20] WARN -- : [cfbf2f05-e578-41e3-957f-6013dc4d1716] HTTP Origin header (http://openstreetmap.apps.mms.local) didn't match request.base_url (http://openstreetmap-web.apps.prod.ocp.mms.local)

  • john_allenjohn_allen Member, A10ers ✭✭

    Um.....looks like I gave you a typo :(

    HTTP::header replace Origin "openstreetmap-web.apps.prod.ocp.mms.local"

    not

    HTTP::header replace Orgin "openstreetmap-web.apps.prod.ocp.mms.local"

    Try that.

  • :) anyways thanks for your time

  • nehakakarnehakakar Member

    You can try following script.


    when HTTP_REQUEST {

       set URI [string tolower [HTTP::uri]]

       switch -glob $URI {

           default {

               HTTP::header replace Origin "openstreetmap-web.apps.prod.ocp.mms.local"

               pool POOL_openstreetmap_prod_ocp

           }

       }

    }

    it uses the HTTP::header replace command to modify the Origin header to openstreetmap-web.apps.prod.ocp.mms.local. Additionally, it directs the request to the specified pool POOL_openstreetmap_prod_ocp.

Sign In or Register to comment.