Forum Discussion
Samir
MVP
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
}
}
Apidude
Sep 14, 2022Nimbostratus
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