Forum Discussion
Fletcher_Cocquy
Nimbostratus
Mar 19, 2010x-forwarded-host
Hi, we have our BigIP adding the x-forwarded-for header, but we have a new app with a new requirement for the x-forwarded-host header.
What is the recommended way to do this?
iRule?
If so, what would the iRule look like?
thanks
5 Replies
- hoolio
Cirrostratus
Hi Fletcher,
If you're currently using a custom HTTP profile with the Insert X-Forwarded-For option enabled, you could add this to the Request Header to Insert field:
x-forwarded-host: [HTTP::host]
However, I'm not sure why the host header value would be changed by LTM unless you're using an iRule to rewrite it.
Aaron - Fletcher_Cocquy
Nimbostratus
Are the "Header Insert" field entries space delimited?
so if I already have GOHTTPS:1 and want to add x-forwarded-host: [HTTP::host] the final entry would be:
GOHTTPS:1 x-forwarded-host:[HTTP::host]
?
Or are they comma delimited?
Is it best to put the individual entries in quotes?
thanks - hoolio
Cirrostratus
I don't think you can insert multiple header name/values with an HTTP profile. There's probably a request for enhancement to support this. You could open a case with F5 Support to ask to have your case attached to the RFE.
In the meantime, you can use an iRule to insert multiple HTTP headers:when HTTP_REQUEST { Insert GOHTTPS and x-forwarded-host with corresponding values HTTP::header insert GOHTTPS 1 x-forwarded-host [HTTP::host] }
Aaron - Fletcher_Cocquy
Nimbostratus
Hi, I did not want to combine the GOHTTPS with the x-forwarded-for - so I did:
when HTTP_REQUEST {
Insert x-forwarded-host with corresponding value
HTTP::header insert x-forwarded-host [HTTP::host]
}
works great, thanks - hoolio
Cirrostratus
HTTP::header insert accepts lists of header names and values, so this would insert GOHTTPS with a value of 1 and x-forwarded-host with a value of the HTTP host header value:
HTTP::header insert GOHTTPS 1 x-forwarded-host [HTTP::host]
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
