Nginx+uwsgi+Django的HTTPS问题
搭建了一台nginx+uwsgi+django1.3的服务器。由于设计需要必须走HTTPS,但是按照默认配置后访问却总是出现问题。查阅了uwsgi文档后解决了。
server { listen 80; server_name 127.0.0.1; ssl on; ssl_certificate server.crt; ssl_certificate_key server.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; access_log logs/access_log; uwsgi_connect_timeout 300; location / { uwsgi_param UWSGI_SCHEME https; uwsgi_pass 127.0.0.1:9000; include uwsgi_params; } location /static { alias /var/www/html/static; access_log off; } location /tmp { alias /tmp; access_log off; } }
问题的关键是这行:
uwsgi_param UWSGI_SCHEME https;
REF:http://projects.unbit.it/uwsgi/wiki/uWSGIVars
相关推荐
岁月如歌 2020-07-27
lreis00 2020-06-29
89403969 2020-06-12
ZhaoMengjiao 2020-06-09
87193750 2020-05-30
咻咻ing 2020-05-17
eightbrother 2020-05-05
87254055 2020-04-14
ZhaoMengjiao 2020-03-28
ZhaoMengjiao 2020-03-08
89403969 2020-03-04
89403969 2020-03-04
87193750 2020-02-24
85407718 2020-02-09
eightbrother 2020-01-02
vanturman 2019-12-26
山顶冻人 2019-12-25
aolishuai 2019-12-13
89403969 2019-12-11