简体   繁体   中英

Apache - Exclude local network to redirect HTTPS

I have configured virtualhost as below

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]

I require to exclude redirecting HTTP to HTTPS request for my local network/subnet ie. (172.16.0.0/16)

I am using GCP HTTP loadbalancer.

Can somebody help me to resolve this issue. Thanks

GCP launched http to https redirection at the load balancer so you don't need to configure rewrite rule on apache anymore, with this said, you can access backends either directly from your local Nerwork or you can separately have an internal http load balancer on http to access it from local network and external for external users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM