Forum Discussion
Sabeer_Ali_2389
Feb 05, 2016Altostratus
X-Forwarded in F5
We have below X-Forwarded configured on our cisco ACE , now we are migrating the VIP to F5 LTM. How we can configure the X-Forwarded in F5 ?
insert-http X-Forwarded-Proto header-value "%is"
...
Brad_Parker_139
Feb 05, 2016Nacreous
Just notice you also mentioned X-Forward-Proto and X-Forwarded-Port, if you want that you will have to either use a local traffic policy or an iRule. A real easy irule to add those is this.
when CLIENT_ACCEPTED {
if { [PROFILE::exists clientssl] == 1 } {
set protocol "https"
}
else {
set protocol "http"
}
}
when HTTP_REQUEST {
HTTP::header replace X-Forwarded-Proto $protocol
HTTP::header replace X-Forwarded-Port [TCP::local_port]
}
- Kai_WilkeFeb 05, 2016MVPHey Brad, is the ">=" expression required in the case that multiple SSL profiles are used?
- Brad_Parker_139Feb 05, 2016Nacreousyeah, but then I realized "exists" is 0 or 1. Brain was going in two directions.
- Brad_Parker_139Feb 05, 2016Nacreousexists vs counting is sometimes hard...
- Kai_WilkeFeb 05, 2016MVPOkay, good to know... ;-) BTW: { [PROFILE::exists clientssl] == 1 } does the same as { [PROFILE::exists clientssl] }, but the later is slightly faster. But on the other hand inserting an "== 1" would make the clause more visible...
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