Forum Discussion

joyharry_281042's avatar
joyharry_281042
Icon for Nimbostratus rankNimbostratus
Jul 22, 2016

How to Allow Underscore in HTTP Header?

Hello All,

 

I am working on the requirement to allow underscores in HTTP headers by default F5 does not allow it. Can anybody let me know what I need to do at the F5 end to allow underscores like writing a iRule? If I need to write an iRule what I need to check as I am very new to Load Ba lancer world?

 

Any help is greatly appreciated!!

 

13 Replies

  • what part of the F5 BIG-IP does not allow them?

     

    in general you see different kind of products not really liking underscores in HTTP header although the RFC doesn't disallow them. perhaps it would be better to stay away from them.

     

    as for iRule just browse here, there are many good articles on them. but first explain your need a bit better.

     

  • All you need to do to make this load balance properly is to apply a cookie persistence profile to your virtual server. In the virtual server you can configure it to insert X-Forwarded-For header as the URL requires. You do not need any special headers to achieve what that document describes.

     

    • joyharry_281042's avatar
      joyharry_281042
      Icon for Nimbostratus rankNimbostratus

      Thanks for the response ekaleido.

       

      https://www.ibm.com/support/knowledgecenter/SSRQBP_2.0.2/com.ibm.ispim.doc/installing/ref/r_load_balancer_settings.html

       

      As mentioned in the URL it's a virtual appliance on which internally IBM HTTP server is running but virtual appliance is kind of black box thing where we can't make any changes to the web server or application server so whatever load balancer requirement are there we have to implement on the load balancer side. Can you please help how can I implement the requirements on load balancer side? We are able to insert X-Forwarded-For header but facing challenges to allow underscores in the request headers?

       

    • ekaleido_26616's avatar
      ekaleido_26616
      Icon for Cirrocumulus rankCirrocumulus

      Underscores in headers are fine by the F5. I've copied a link showing this in a packet capture:

       

      https://devcentral.f5.com/s/feed/0D51T00006i7X5xSAE

       

    • joyharry_281042's avatar
      joyharry_281042
      Icon for Nimbostratus rankNimbostratus

      Thanks all for your support.

       

      Issue has been resolved. Underscores are allowed by default in F5, no specific configuration is required to achieve to allow underscores.

       

      Thanks!!

       

  • All you need to do to make this load balance properly is to apply a cookie persistence profile to your virtual server. In the virtual server you can configure it to insert X-Forwarded-For header as the URL requires. You do not need any special headers to achieve what that document describes.

     

    • joyharry_281042's avatar
      joyharry_281042
      Icon for Nimbostratus rankNimbostratus

      Thanks for the response ekaleido.

       

      https://www.ibm.com/support/knowledgecenter/SSRQBP_2.0.2/com.ibm.ispim.doc/installing/ref/r_load_balancer_settings.html

       

      As mentioned in the URL it's a virtual appliance on which internally IBM HTTP server is running but virtual appliance is kind of black box thing where we can't make any changes to the web server or application server so whatever load balancer requirement are there we have to implement on the load balancer side. Can you please help how can I implement the requirements on load balancer side? We are able to insert X-Forwarded-For header but facing challenges to allow underscores in the request headers?

       

    • joyharry_281042's avatar
      joyharry_281042
      Icon for Nimbostratus rankNimbostratus

      Thanks all for your support.

       

      Issue has been resolved. Underscores are allowed by default in F5, no specific configuration is required to achieve to allow underscores.

       

      Thanks!!

       

  • Even I think the same.

     

    underscores in request headers are default allowed as per RFC but uncommon. You need to enable it in the server side and i dont think any changes required on F5 BIG IP.

     

    -Jinshu

     

  • is this the line that worries you joyharry?

    Set the Load Balancer to allow underscores in request headers. For example, set the value of the underscores_in_headers custom header directive to on in Nginx.

    as mentioned by a few people now the F5 does allow this, if you feel differently please show us where it says it doesn't work.