Forum Discussion

dabance's avatar
dabance
Icon for Altocumulus rankAltocumulus
Sep 26, 2019

maintenance page based on URL

Hello,

 

Could you help with below requirement for an irule

I would like to redirect to a maintenance message based on URL like below. (http vs https)

 

 

if url is "http://www.xyx.com:8080" should redirect to maintenance page "The site is under maintenance"

if url is "https://www.xyx.com:8080" should redirect to default pool

  • Hi dabance,

    As I understood, you use only one ssl virtual server with port 8080 and you want to response for http requests with port 8080.

    Firstly, you should to enable Non-SSL Connections in Client SSL Profile.

    After you can use this iRule:

    when CLIENTSSL_HANDSHAKE {
    	set https_state 1
    }
     
    when HTTP_REQUEST {
    	if { ![info exists https_state] } {
    		HTTP::respond 200 content "The site is under maintenance" 
    	}
    }
  •  Thank you for the response. But there is a problem, We do not have ssl offloading on LB , instead its on server side.