Varnish 3.0 with Nginx SSL Termination on Ubuntu 12.04 [endless loops issue]

自古美人都是妖i 提交于 2019-12-11 13:17:13

问题


I followed this guide and successfully setup my server which works as follows:

OVER HTTPS

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

OVER HTTP

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

Now when I visit my site on HTTPS, it goes on "endless loop". I get "Page isn't redirecting properly" error on the browser.

I tried to tell Apache to return response on HTTPS as follows:

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 possibly is going wrong? What do I need to configure to come out of the loop?

NOTE: I'm running Varnish 3.0 on Ubuntu 12.04.


回答1:


Try leaving Varnish out of the path when using HTTPS

So... instead of ==>>

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

Just use this ==>>

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



来源:https://stackoverflow.com/questions/30152764/varnish-3-0-with-nginx-ssl-termination-on-ubuntu-12-04-endless-loops-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!