Gunicorn根视图不再适用于SSL nginx代理

我有一个Django项目,显示根目录上的login视图。 这是url模式:

url(r'^$', views.login_view, name="root_login") 

这工作在一个未encryption的连接:当我在浏览器中访问http://example.com ,我得到我的login模板。

我最近使用letsencrypt在我的nginx代理上安装了SSL证书。 现在,当我尝试https://example.com我得到“Welcome to nginx!” 页。 当我使用不同的URL模式(例如, https://example.com/login )时,应用程序服务器按预期呈现视图。 实际上,除了根目录以外,所有的应用程序服务器视图都可以工

所以我猜我的location /上下文在我的SSL服务器块的nginxconfiguration是错误的,但我不明白在哪里,因为它是完全相同的location /上下文在我的未encryption的80端口块,它的工作原理。 这是整个SSL块 – 我的错误在哪里?

 server { #SSL connection listen 443; ssl on; server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_dhparam /etc/ssl/certs/dhparam.pem; ssl_ciphers #omitted for brevity; ssl_session_timeout 1d; ssl_session_cache shared:SSL:1m; ssl_stapling on; ssl_stapling_verify on; add_header Strict-Transport-Security max-age=15768000; #serve static content location /static { alias /path/to/static; } #proxy connection to application server location / { proxy_pass http://app_servers; #the gunicorn unix socket proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; } }