A typical issue when SSL termination is performed on the load balancer is that URL redirects from the backend servers still contain a ‘http://’ prefix rather then ‘https://’
Within this article we will show the required commands for creating a Content Switching Policy that will rewrite any URL`s containing a ‘http://’ prefix to ‘https://’ for traffic originating from the backend servers. This is also known as a reverse rewrite.
CSW Rule
csw-rule “bodyhttp” response-body pattern “http://”
csw rule “redirection” response-header “Location” pattern “http://”
csw-rule “responsestatus” reponse-status-code 301 302
csw-rule “urlexists” url exists
CSW Policy
csw-policy “rewritehttp” type reponse-rewrite
match “urlexists” response-body-rewrite
match “responsestatus” reponse-header-rewrite
match “rediretlocation” rewrite response-header-replace “https://” offset 0 length 7
match “bodyhttp” rewrite reponse-body-replace “https://” offset 0 length 7
Assign to Virtual Server
server virtual XXX
port ssl response-rewrite-policy “rewritehttp”
- NETCONF & YANG: Automate Network Configs via Python - April 2, 2026
- Palo Alto – How to Configure Your Next-Generation Firewall - April 2, 2026
- How to Harden Linux SSH: Keys, Fail2ban & Ciphers - March 1, 2026
Want to become a networking expert ?
Here is our hand-picked selection of the best courses you can find online:
Cisco CCNA Certification Gold Bootcamp
Complete Cyber Security Course – Network Security
Internet Security Deep Dive course
Python Pro Bootcamp
and our recommended certification practice exams:
Delta Practice Tests