Mixed Content warnings when using SSL Offloading

Mixed Content warnings when using SSL Offloading

book

Article ID: CTX232356

calendar_today

Updated On:

Description

When accessing a Web Application via a HTTP Load Balancer, there are no issues.
However, when accessing the same Web App from a HTTPS Load Balancer (HTTP on backend) the site can:

  1. Redirect users back to a start page constantly or
  2. Not display correctly, report Mixed Content warning in the Browser


This is generally caused by the responses from the backend Web Application containing Absolute links pointing to HTTP resources


To fix this you need to create the below Rewrite Policy and bind it as a Response policy to the Load Balancing or Content Switching vServer:

add rewrite action replace_http_with_https_act replace_all "http.RES.BODY(1000000)" "\"https://fqdn.of.server/\"" -search "regex(re~http://fqdn.of.server(:80)/~)"

add rewrite policy replace_http_with_https_pol true replace_http_with_https_act


This will rewrite the links in the responses from both "http://fqdn.of.server/" and "http://fqdn.of.server:80/" to "https://fqdn.of.server/"


If the above Rewrite action and Policy does not properly work for your website, try this other one:
 

add rewrite action MCRewriteAction replace_all http.res.body(50000) "\"https://\"" -pattern http://

add rewrite policy MCRewritePolicy "http.res.body(50000).contains(\"http://\")" MCRewriteAction


Issue/Introduction

Some web apps are designed in HTTP and can use the NetScaler's SSL Offloading options to provide an SSL Proxy for external access. However, some web apps can run into issues when an SSL Proxy is put in front of them