1
我需要让uWSGI只允许通过https进行连接。 我只能使用uWSGI而不能使用NGINX等额外应用程序。uWSGI配置使用HTTPS
现在,我会满足,如果我可以使https部分作品。
我试过了uwsgi站点的代码(稍作修改):http://uwsgi-docs.readthedocs.io/en/latest/HTTPS.html。但它不起作用。
[uwsgi]
master = true
socket = 127.0.0.1:9000
shared-socket = 0.0.0.0:443
https = =0,foo.crt,foo.key,HIGH
module=project.wsgi:application
enable-threads = true
vacuum = true
die-on-term = true
从浏览器中,我得到了网站无法达到 我有相同的文件夹上面和下面的代码配置文件证书“foo.crt”和“foo.key”。证书是自签名证书。
我也尝试下面的代码,但只适用HTTP和HTTPS不是:
[uwsgi]
;master process with 5 workers.
master = true
processes = 5
http = :80
https = :443,foo.crt,foo.key
buffer-size = 32768
module=project.wsgi:application
enable-threads = true
vacuum = true
die-on-term = true
如果你知道如何使这个HTTPS作品那会真棒。 甚至更好,如果它还包括http重定向到https。
在此先感谢。
第一眼事情是不对您的HTTPS指令。它在开始时不具有= 0或= 1。看到这个答案http://stackoverflow.com/a/37511426/334346。注意那里的http-to-https指令。 – Oleg