2
我的應用程序遇到了一些麻煩。在重定向期間,我的燒瓶應用程序會丟失https並重定向到http。Nginx,gunicorn,python-flask應用程序。 Https在重定向時丟失了
我一直在試圖找到解決方案,但沒有任何工作。
我的應用程序(位置/)nginx的配置如下:
proxy_pass http://localhost:5400;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-port 443;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
(Internet上一些例子說,使用「X - 轉發,原」我已經試過了沒有成功。同時也使用「ssl」或「https」作爲該參數的值。
瓶子應用程序(before_request :)中的一個簡單打印顯示它仍然是http-requests made事件,雖然我在客戶端和nginx之間使用https 。
print(request.environ["wsgi.url_scheme"])
我在做什麼錯?
你是否設法解決這個問題? – Markus