Forum Discussion
Sams_88783
Apr 05, 2011Nimbostratus
Irule Help
I have created 2 VIP's.
1) VIP is with port 80 and nodes with port 8080
2) VIP is with port 8080 with irule
The requirement is VIP 2 with port 8080 to not have the har...
hoolio
Apr 05, 2011Cirrostratus
Hi Sams,
So you want to redirect any request made to the VS:8080 to VS:80? If so, you can use getfield to remove the port and send the redirect:
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPToHTTPSRedirect_301.html
when HTTP_REQUEST {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
}
This strips the port number from the host header and sends a 301 to the new location. If you want to send a 302 instead, just change the status code in HTTP::respond.
If I've misinterpreted your scenario, let me know.
Aaron
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