Forum Discussion

GianlucaP81_302's avatar
GianlucaP81_302
Icon for Nimbostratus rankNimbostratus
May 19, 2017

redirect to https non standard poprt

Hi, the requirement is:

http://virtualip:7777    have to be redirect to https://publicip:44444/abc

I was working with Proxypass adding a datagroup:

  • string: virtualip:7777
  • value:

it seems that the url redirect it works but is not working the port redirect 44444. The redirect is on port 443. Someone can help ?

1 Reply

  • Hi,

    Not sure what issue you have. Just attach below iRule to virtual:7777 VS and it should work:

    when HTTP_REQUEST {
           HTTP::redirect https://publicip:44444/abc
    }
    

    Of course assuming that every request to should be redirected to static URI /abc.

    If it's not the case use:

    when HTTP_REQUEST {
           HTTP::redirect https://publicip:44444[HTTP::uri]
    }
    

    Be aware that HTTP::redirect is always using 302 Found. If you need 301 then you have to use HTTP::respond, something like that:

    HTTP::respond 301 Location "Connection" "close"

    adding appropriate headers as needed

    Piotr