Forum Discussion
Apidude
Nimbostratus
Sep 13, 2022iRule required to redirect URL to same URL but different port
I am looking for an iRule for this scenario: A VIP handles traffic to multiple host fields on the same IP address. This is always mapped to the same server pool. Based on the requested host field in...
Samir
MVP
Sep 13, 2022You 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
}
}
- ApidudeSep 14, 2022
Nimbostratus
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, 2022
Nimbostratus
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
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