F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

N_67263's avatar
N_67263
Icon for Nimbostratus rankNimbostratus
Jan 22, 2014

Help regarding an iRule

Folks.

 

I am looking at an iRule that would help accept an http request on port 8080 on the VIP and then forward the request on https port 8080 to the back end servers. any help?

 

regards, Nik

 

4 Replies

  • You do not need an iRule. Simply assign the serverssl profile in the virtual and make sure the pool members are using port 8080.

     

  • as kevin said, you do not need irule. it is just serverssl.

    e.g.

     config
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:8080
        ip-protocol tcp
        mask 255.255.255.255
        pool foo
        profiles {
            serverssl {
                context serverside
            }
            tcp { }
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 3
    }
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
    ltm pool foo {
        members {
            200.200.200.101:8080 {
                address 200.200.200.101
            }
        }
    }
    
     test
    
    [root@ve11a:Active:In Sync] config  curl -I http://172.28.24.10:8080/
    HTTP/1.1 200 OK
    Date: Thu, 23 Jan 2014 03:42:01 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Thu, 23 May 2013 00:28:46 GMT
    ETag: "4185a8-59-c3efab80"
    Accept-Ranges: bytes
    Content-Length: 89
    Content-Type: text/html; charset=UTF-8
    
    
  • Here is a minor twist, the requirement says that we need the incomming requests to come on port 8080(http) and then redirect these to https.

     

  • the requirement says that we need the incomming requests to come on port 8080(http) and then redirect these to https.

    the https is on port 443, isn't it? so, you will create new https virtual server, won't you?

    e.g.

    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:8080
        ip-protocol tcp
        mask 255.255.255.255
        profiles {
            http { }
            tcp { }
        }
        rules {
            _sys_https_redirect
        }
        source 0.0.0.0/0
        vs-index 7
    }
    
    [root@ve11a:Active:In Sync] ~  curl -I http://172.28.24.10:8080/something
    HTTP/1.0 302 Found
    Location: https://172.28.24.10/something
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0