Forum Discussion

Michael_Basil_5's avatar
Michael_Basil_5
Icon for Nimbostratus rankNimbostratus
Jan 13, 2012

8080 to 8443 iRule issue

I have the following setup:

 

 

client app running on port 80 and port 8080. ssl is offloaded to the load balancer on ports 443 and 8443 respectively.

 

 

 

The application that is running sometimes writes fully qualified URL links, so I need an iRule to map the request appropriately. The following works for the 80 to 443 mapping:

 

 

 

when HTTP_REQUEST {

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

 

 

I am trying to do a similar iRule to handle the 8080 to 8443 mapping:

 

 

 

when HTTP_REQUEST {

 

HTTP::redirect https://[HTTP::host]:8443[HTTP::uri]

 

}

 

 

 

However, this does not seem to work. Can anyone tell me what I am missing?

 

 

 

So, it's clear the web browser will connect to my site like this:

 

 

 

https://x.com:8443

 

 

 

Let's say there is an anchor on the page which has been (poorly) written out like this:

 

 

 

http://x.com:8080/go

 

 

 

I need the load balancer to see that url and redirect the browser to

 

 

 

https://x.com:8443/go

 

 

 

Again, I have no issues with the similar redirect going from 80 to 443.

 

 

 

Thanks.

 

2 Replies

  • is this correct?

     

     

    [root@ve1023:Active] config b virtual bar list

     

    virtual bar {

     

    destination 172.28.19.79:8080

     

    ip protocol 6

     

    rules myrule

     

    profiles {

     

    http {}

     

    tcp {}

     

    }

     

    }

     

    [root@ve1023:Active] config b rule myrule list

     

    rule myrule {

     

    when HTTP_REQUEST {

     

    HTTP::redirect " [HTTP::host] ":" 1]:8443[HTTP::uri]"

     

    }

     

    }

     

     

    [root@ve1023:Active] config curl -I http://172.28.19.79:8080/go

     

    HTTP/1.0 302 Found

     

    Location: https://172.28.19.79:8443/go

     

    Server: BigIP

     

    Connection: Keep-Alive

     

    Content-Length: 0

     

  • I get the following with the way I have it setup.

     

     

    xuser:/xdata/temp@xmb$curl -I http://catracks-uat.northwestern.edu:8080/go

     

    HTTP/1.0 302 Found

     

    Location: https://catracks-uat.northwestern.edu:8080:8443/go

     

    Server: BigIP

     

    Connection: Keep-Alive

     

    Content-Length: 0

     

     

    I think I see where the iRule is incorrect (need the getfield syntax). I've passed along the info to the network engineer. Thanks for the quick reply. I'll update once I have tested out the new configuration.