Forum Discussion
iRule required to redirect URL to same URL but different port
You can try something like this.. I haven't tested but hopefully work.
when HTTP_REQUEST {
if { ([getfield [HTTP::host] ":" 1]:[TCP::local_port]) equals "8080" } {
HTTP::respond 301 Location "http://[HTTP::host]/abc.html"
# http://[HTTP::host]:80/abc.html >>> Same like http://[HTTP::host]/abc.html
}
}
Thank you so much Samir! BUT ... I am looking for something like this:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] starts_with "abc.com:8080" } { TCP::local_port replace 80 } }
Does this look like it would work to take the connection on TCP/8080 from the client and send it to the server pool on TCP/80?
- ApidudeSep 14, 2022Nimbostratus
I think this might be correct?
when HTTP_REQUEST { if {[string tolower [HTTP::host]] starts_with "abc.com:8080" } { set new_port 80 } }
Please let me know what you think
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