Author Topic: [Solution] Nginx + Varnish + Apache force SSL .htaccess Redirect Loops  (Read 479 times)

0 Members and 1 Guest are viewing this topic.

Offline
****
Whenever you are using [Nginx + Varnish + Apache] or [Nginx + Apache] you need to tell Apache that a SSL request is being served by a proxy server. So use the code below to force SSL .htaccess

Code: [Select]
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IFModule>

Offline
*
Re: [Solution] Nginx + Varnish + Apache force SSL .htaccess Redirect Loops
« Reply #1 on: September 27, 2018, 03:35:21 PM »
Hi.
Where i put this code?
With this code all domains redirect to https?