【问题标题】:nginx: trying to enable https results in 'This webpage has a redirect loop'nginx:尝试启用 https 会导致“此网页有重定向循环”
【发布时间】:2014-09-27 20:41:46
【问题描述】:

在我的 nginx 配置中,如果我有以下设置,每当我访问该站点时,我都会收到“此网页有重定向循环”

server {
    listen 80;
    merge_slashes off;
    server_name domain.com www.domain.com
    rewrite ^(.*) https://$host$1 permanent; 
}

server {
     listen 443;
     merge_slashes off;
     server_name domain.com www.domain.com;

     location / { try_files $uri @app; }
       location @app {
          include uwsgi_params;
          uwsgi_pass 0.0.0.0:5002;
     }
}

【问题讨论】:

    标签: nginx https cloudflare


    【解决方案1】:

    尝试添加:

    ssl on;
    ssl_certificate      /xxx/bundle.pem;
    ssl_certificate_key  /xxx/server.key;
    

    【讨论】:

    • 我正在使用来自 cloudflare 的灵活 SSL,但没有提供这些。我现在收到SSL handshake failed
    • 现在我得到'这个网页有一个重定向循环重新加载'
    • 在 https/http 之间重定向?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-03
    • 2012-09-22
    • 2012-03-05
    • 2013-01-03
    • 2016-06-15
    • 2015-10-09
    相关资源
    最近更新 更多