在 NGINX 后面使用 SSL 的 WSGI

WSGI with SSL behind NGINX

目前我想在服务器上部署我的金字塔应用程序。因此我在 WSGI 之前使用 NGINX。在NGINX中配置SSL没有问题,但是对于WSGI就是了。

因为我有从 80 到 443 的端口转发,用户收到:

Mixed Content: The page at 'https://example.com' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/static/css/bootstrap-3.3.5.min.css'. This request has been blocked; the content must be served over HTTPS.

如何为 WSGI 启用 SSL?

感谢

感谢 我找到了解决方案。只需将 "url_scheme = https" 添加到您的 production.ini / development.ini.