Forum Discussion
rewrite response DNS name to an IP address
I have a test VMware workspace server that is redirecting IP to a DNS name which is not valid on the internet. I would like to rewrite the response packets to the VIP IP address. For example, I go to https://1.1.1.1 and the server replies/redirects to https://workspace.mydomain.com/xxx/xxx but workspace.mydomian.com is not a valid name on the Internet so the session fails. I want to rewrite the response so the IP address stays in the URL header and removes the DNS host name but keeps the URI information in place.
Can someone tell me how this could be done?
1 Reply
Maybe something like this?
when HTTP_RESPONSE { if { [HTTP::is_redirect] } { set location [string tolower [HTTP::header values Location]] if { $location contains "workspace.mydomain.com" } { HTTP::header replace Location [string map {"workspace.mydomain.com" "2.2.2.2"} $location] } } }/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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