Forum Discussion
Ahmad_03_151082
Nimbostratus
Apr 29, 2015HTTP to HTTPs exclude URLs
Hello
I am facing problem with my iRule which is redirect HTTP to HTTPs
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host][HTTP::uri]] {
"xyz.com/pubportal/something" -
"xy...
Robert_Luechte1
Nimbostratus
Apr 29, 2015Try putting a log statement in before the switch statement so you can see the values you are using in the switch.
log local0. "HTTP Host and path is: [string tolower [HTTP::host][HTTP::uri]]"
Also, do you need to check the host portion? Do you have multiple domains that use this IP address?
Ahmad_03_151082
Nimbostratus
Apr 29, 2015Hi robert
no i donot have multiple domains
yes i need to check the host portion
I have applied the above i got the below result
curl -I oservices.bahrain.bh
HTTP/1.0 302 Found
location: https://oservices.bahrain.bh/wps/portal
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
curl -I http://oservices.bahrain.bh/pubportal/WebServiceVehicleRegistration/services/Controller
HTTP/1.0 302 Found
location: https://oservices.bahrain.bh/WebServiceVehicleRegistration/services/Controller
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
curl -I oservices.bahrain.bh/pubportal/InsuranceDetailsUploadWS/services/InsuranceUploadImpl
HTTP/1.0 302 Found
location: https://oservices.bahrain.bh/InsuranceDetailsUploadWS/services/InsuranceUploadImpl
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
curl -vI http://oservices.bahrain.bh/pubportal/WebServiceVehicleRegistration/services/Controller
* About to connect() to oservices.bahrain.bh port 80 (0)
* Trying 192.168.214.6... connected
* Connected to oservices.bahrain.bh (192.168.214.6) port 80 (0)
> HEAD /pubportal/WebServiceVehicleRegistration/services/Controller HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-suse-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.10
> Host: oservices.bahrain.bh
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
HTTP/1.0 302 Found
< location: https://oservices.bahrain.bh/WebServiceVehicleRegistration/services/Controller
location: https://oservices.bahrain.bh/WebServiceVehicleRegistration/services/Controller
< Server: BigIP
Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
Connection: Keep-Alive
< Content-Length: 0
Content-Length: 0
<
* Connection 0 to host oservices.bahrain.bh left intact
* Closing connection 0
curl -vI oservices.bahrain.bh/pubportal/InsuranceDetailsUploadWS/services/InsuranceUploadImpl
* About to connect() to oservices.bahrain.bh port 80 (0)
* Trying 192.168.214.6... connected
* Connected to oservices.bahrain.bh (192.168.214.6) port 80 (0)
> HEAD /pubportal/InsuranceDetailsUploadWS/services/InsuranceUploadImpl HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-suse-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.10
> Host: oservices.bahrain.bh
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
HTTP/1.0 302 Found
< location: https://oservices.bahrain.bh/InsuranceDetailsUploadWS/services/InsuranceUploadImpl
location: https://oservices.bahrain.bh/InsuranceDetailsUploadWS/services/InsuranceUploadImpl
< Server: BigIP
Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
Connection: Keep-Alive
< Content-Length: 0
Content-Length: 0
<
* Connection 0 to host oservices.bahrain.bh left intact
* Closing connection 0
curl -vI oservices.bahrain.bh
* About to connect() to oservices.bahrain.bh port 80 (0)
* Trying 192.168.214.6... connected
* Connected to oservices.bahrain.bh (192.168.214.6) port 80 (0)
> HEAD / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-suse-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.10
> Host: oservices.bahrain.bh
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
HTTP/1.0 302 Found
< location: https://oservices.bahrain.bh/wps/portal
location: https://oservices.bahrain.bh/wps/portal
< Server: BigIP
Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
Connection: Keep-Alive
< Content-Length: 0
Content-Length: 0
<
* Connection 0 to host oservices.bahrain.bh left intact
* Closing connection 0
vprwp:/usr/IBM/WebSphere/w
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects