Forum Discussion
Moinul_Rony
Altostratus
Mar 17, 2014Want to insert X-Forwarded-for Original Hostname.
One of our virtual server has an irule to rewrite the original incoming URL to a custom URL toward the server.
How can I include the original hostname as a X-Forwarded-For header so that that can ...
IheartF5_45022
Nacreous
Mar 17, 2014Personally I would not use X-Forwarded-For as it's now a de-facto RFC-header which is used to store an IP address. Here is what you need (chose your own header name);-
when HTTP_REQUEST {
if {[HTTP::host] equals "original.hostname.com" } {
Replace host header value original.hostname.com with custom.hostname.com
HTTP::header insert X-Forwarded-Host [HTTP::header Host]
HTTP::header replace Host custom.hostname.com
}
}
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