20
重定向我有一個flask應用程序,通過uwsgi主辦,nginx作爲反向代理向uwsgi,使用內置在uwsgi proxy module。無論何時訪問重定向到其他頁面的頁面,位置標題都會指向非HTTPS URL。例如:不需要的HTTPS - > HTTP與nginx的+ uwsgi +燒瓶應用
$ socat openssl:my-web-server:443 stdio
GET/HTTP/1.0
Host: my-web-server
HTTP/1.1 302 FOUND
Server: nginx/1.0.4
[...]
Location: http://my-web-server/login
我的nginx的配置是這樣的:
server {
listen 80;
listen 443 ssl;
server_name my-web-server;
charset utf-8;
ssl_certificate /etc/nginx/certs/server.pem;
ssl_certificate_key /etc/nginx/certs/server.key;
location/{
uwsgi_pass unix:/tmp/uwsgi.sock;
include uwsgi_params;
}
}
這正是我正在尋找的。謝謝。 – stephenmuss