Forum Discussion
URL Header rewrite question
We are working on an irule where we want to achieve a specific outcome. If the client access abc.example.com , the header rewrites and change it to xyz.apps.example.com . That actually works , but we wanted to see abc.example.com on the client's view and not the xyz.apps.example.com , so it looks like transparent . We added http_response but seems like its not working . I would appreciate any help. Thanks
when HTTP_REQUEST {
if { [HTTP::header "Host"] equals "abc.example.com" } {
HTTP::header replace Host "xyz.apps.example.com "
}
}
when HTTP_RESPONSE {
if { [HTTP::header "Host"] equals "xyz.apps.example.com " } {
HTTP::header replace Host "abc.example.com"
}
}
1 Reply
- Simon_Blakely
Employee
The browser address bar depends on what links are followed as the page loads - I can only guess, but I expect that there is a redirect somewhere that redirects the page to xyz.apps.example.com, so that is what is shown in the browser address bar.
You need to add a Rewrite profile to rewrite xyz.apps.example.com to abc.example.com in http responses
-----
About Rewrite profiles
For environments that use web servers, you might want your websites to appear differently on the external network than on the internal network. For example, you might want the BIG-IP® system to send traffic destined for www.company.com/usa/ to the internal server usa.company.com instead. Normally, this translation could cause some issues, such as the web server expecting to see a certain host name (such as for name-based virtual hosting) or the web server using the internal host name when sending a redirect to client systems.
You can solve these problems by configuring a Rewrite profile, which causes the BIG-IP system to act as a reverse proxy server. As a reverse proxy server, the BIG-IP system offloads the URI translation function from web servers enabled with features such as Apache's ProxyPass module. With a Rewrite profile, the BIG-IP system can perform URI scheme, host, port, and path modifications as HTTP traffic passes through the system. The feature also provides reverse translation for the Location,Content-Location, and URI headers in the server response to the client.
-----
Recent Discussions
Related Content
* 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