Forum Discussion

Christian_Greyl's avatar
Christian_Greyl
Icon for Nimbostratus rankNimbostratus
Feb 25, 2016

XMLHttpRequest error with HTTP to HTTPS redirect rule

Hi

 

So Im redirecting our HTTP traffic to HTTPS on the F5 with an Irule.

 

The problem is that the browsers are saying there's an unsafe script trying to load and blocks some people from accessing the site.

 

It says '' was loaded over https , but requested an insecure XMLHttpRequest endpoint. '' This request has been blocked; the content must be served over HTTPS.

 

Do I need to do something special for XMLHttpRequest ?

 

If I load the 'unsafe script' it loads the XML in normal HTTP and works but then there is a line through the HTTPS.

 

3 Replies

  • Hi This is the HTTP to HTTPS irule. when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } I should also add these two rules that redirect to two different servers based on the URL after the traffic is moved to HTTPS when HTTP_REQUEST { if { [HTTP::host] equals "smartit.randomdomain.com" and [HTTP::uri] equals "/" }{ HTTP::redirect "https://smartit.randomdomain.com/ux/smart-it//" } if { [HTTP::host] equals "myit.randomdomain.com" and [HTTP::uri] equals "/" } { HTTP::redirect "https://myit.randomdomain.com/ux/myitapp//" } }