Forum Discussion
quattroginger
Nimbostratus
Jul 11, 2025irule for redirect and header injection
we have an application going through APM with AD authentication. A irule is applied to redirect it directly to backend server and is functioning. I need to insert "X-Authenticated-User" "true" to the...
VGF5
Cumulonimbus
Jul 11, 2025Your iRule logic is correct for "inject header only if not redirecting." If you want the header to be present on requests that are redirected, that's not possible, redirects are handled by the client, not the backend. If you want the header on proxied requests, your iRule is correct.
Here is the irule
when HTTP_REQUEST {
if { ([HTTP::uri] equals "/app123") or ([HTTP::host] equals "app234.mydomain") } {
HTTP::redirect "https://your-backend-url.example.com"
return
}
HTTP::header replace "X-Authenticated-User" "true"
}
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
