Varnish 3.0 with SSL Nginx termination on Ubuntu 12.04 [infinite loops problem]

I followed this tutorial and successfully set up my server which works like this:

OVER HTTPS

Visitor> Nginx (port 443)> SSL Termination> Lacquer (port 80)> Apache (port 8080)

OVER HTTP

Visitor> Lac (port 80)> Apache (port 8080)

Now when I visit my HTTPS site, it goes into an "endless loop". I get the message "The page is not redirecting as expected" in the browser.

I tried to tell Apache to return the HTTPS response like this:

Added this to my Nginx config:

proxy_set_header X-Forwarded-Protocol $ scheme;

Also added this to my .htaccess file:

if ($ _SERVER ['HTTPS']! == on) {SetEnvIf X-Forwarded-protocol https HTTPS = on

What could be wrong? What do I need to configure to exit the loop?

NOTE. I am running Varnish 3.0 on Ubuntu 12.04.

+1


source to share


1 answer


Try leaving varnish out of the way when using HTTPS

So ... instead of == ->

Visitor> Nginx (port 443)> SSL Termination> Lacquer (port 80)> Apache (port 8080)



Just use this == ->

Visitor> Nginx (port 443)> SSL Termination> Apache (port 8080)

+1


source







All Articles