Forum Discussion
Port 443 iRule Redirect to port 8443
I am created an iRule to forward requests from 443 to port 8443 but it does not seem to be redirecting. There are 2 different urls inlcluded in the iRule. I setup 2 virtual servers. 1 is listening on port 443 with iRule applied and the other is listening on port 8443. Here is an example of the iRule I created.
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "https://mysite.org/CMC" } { HTTP::redirect "https://mysite.org:8443/BOE/CMC" } if { [string tolower [HTTP::host]] equals "https://mysite.org/BI" } { HTTP::redirect "https://mysite.org:8443/BOE/BI" } { } } Did I write this incorrectly? Any help is greatly appreciated.
5 Replies
- Shaun_Simmons1Altostratus Are these Pasthru VIPs? If not, maybe add the needed 8443 port to the Pool member? 443(Internet) -> F5 -> PoolMember:8443 If the same host is listening to 443 and 8443, you could add two pool members with the same IP and add one with 443 and the other with 8443 --? 
- DWillis_251723Nimbostratus Not a pass thru. The virtual server listening on port8443 does have a pool associated with port 8443. It works without issue when entering the full url but the iRule is not redirecting if the user does not enter the full :8443/BOE/CMC. Was looking for the iRule to add the :8443/BOE automatically. 
- Shaun_Simmons1Altostratus Possibly this posting will help; as an example to re-engineer. --https://devcentral.f5.com/questions/redirect-to-a-https-abccom8080-irj-portal Code when HTTP_REQUEST { HTTP::redirect "https://[getfield [HTTP::host] ":" 1]:8443[HTTP::uri]" }
- Vijay_ECirrus Within your iRule, you would have to use these 2: HTTP::host [HTTP::host]:8443HTTP::uri /BOE[HTTP::uri]If you are looking to add ":8443" to domain and /BOE to the URI and pass it to the servers. 
- DWillis_251723Nimbostratus It worked. Thank you 
Recent Discussions
Related Content
* 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