Forum Discussion

yugraj_rai_1230's avatar
yugraj_rai_1230
Icon for Nimbostratus rankNimbostratus
Apr 15, 2014

HTTPS Traffic to redirect into HTTP

When accessing URL https://www.abc.com/404.php but HTTPS is not enabled so please help me to redirect to http for URL

 

Thanks in advance Yugraj Rai

 

12 Replies

  • If this is a response coming from the back end server you are load balancing you could apply a stream profile and use an irule to replace the URL:

    when HTTP_RESPONSE {

       STREAM::expression {@https://www.abc.com/404.php@http://www.abc.com/404.php@} 
    
    
        Enable the stream filter for this response only 
       STREAM::enable 
    
    } else { 
        Disable the stream filter by default 
      STREAM::disable 
    } 
    

    }

    • MW_97676's avatar
      MW_97676
      Icon for Nimbostratus rankNimbostratus
      Sorry missed some of the irule when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains "text/"}{ STREAM::expression {@https://www.abc.com/404.php@http://www.abc.com/404.php@} Enable the stream filter for this response only STREAM::enable } else { Disable the stream filter by default STREAM::disable } }
  • If this is a response coming from the back end server you are load balancing you could apply a stream profile and use an irule to replace the URL:

    when HTTP_RESPONSE {

       STREAM::expression {@https://www.abc.com/404.php@http://www.abc.com/404.php@} 
    
    
        Enable the stream filter for this response only 
       STREAM::enable 
    
    } else { 
        Disable the stream filter by default 
      STREAM::disable 
    } 
    

    }

    • MW1's avatar
      MW1
      Icon for Cirrus rankCirrus
      Sorry missed some of the irule when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains "text/"}{ STREAM::expression {@https://www.abc.com/404.php@http://www.abc.com/404.php@} Enable the stream filter for this response only STREAM::enable } else { Disable the stream filter by default STREAM::disable } }
  • If you are running v11.4.0 or later, it may be better to do this without iRules in local traffic policy. If not yet running v11.4.0 or higher, use this iRule and apply to your port 443 virtual server (assuming you have a separate virtual server for 80 and 443. If not, create separate ones):

    when HTTP_REQUEST {
      HTTP::redirect http://[getfield [HTTP::host] ":" 1][HTTP::uri]
    }
    
  • HI All

     

    Currently we are using "BIG-IP 10.2.1 Build 511.0 Hotfix HF3" version. when i create Irule and associated with my virtual server it throw an error like "010703943:3: STREAM::expression in rule(abc) requires an associated STREAM profile on the virtual serever (Virtual server Name)

     

    Thanks Yugraj Rai

     

  • when i create Irule and associated with my virtual server it throw an error like "010703943:3: STREAM::expression in rule(abc) requires an associated STREAM profile on the virtual serever (Virtual server Name)

     

    just assign default stream profile to the virtual server.

     

    • MW1's avatar
      MW1
      Icon for Cirrus rankCirrus
      agreed has to be applied before the irule, on the main properties tab of the virtual server (think you have to use the drop down to view the advanced settings)
  • when i create Irule and associated with my virtual server it throw an error like "010703943:3: STREAM::expression in rule(abc) requires an associated STREAM profile on the virtual serever (Virtual server Name)

     

    just assign default stream profile to the virtual server.

     

    • MW1's avatar
      MW1
      Icon for Cirrus rankCirrus
      agreed has to be applied before the irule, on the main properties tab of the virtual server (think you have to use the drop down to view the advanced settings)
  • Hi All Finally issue has been resolved as i created one virtual server listen on 443 port and use Irule provided by Cory. Thanks a lot for the support.

     

    Thanks Yugraj Rai