From 887d382da146de0522b1b125db1c3cbe393cc57e Mon Sep 17 00:00:00 2001 From: Jon Banafato Date: Sat, 9 May 2015 12:29:53 -0400 Subject: [PATCH] Add X-Forwarded-Proto to proxy setup example The ProxyFix middleware provided by Werkzeug uses this header for returning accurate values from request.is_secure and request.scheme. Without adding this header, Flask won't properly detect when it is being served over HTTPS and will fail to generate proper external links and cause certain extensions (e.g. Flask-OAuthlib) to function improperly. Adding this header to the example setup should reduce issues encountered by developers when following this guide. --- docs/deploying/wsgi-standalone.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/deploying/wsgi-standalone.rst b/docs/deploying/wsgi-standalone.rst index 5bdd0483..4d006720 100644 --- a/docs/deploying/wsgi-standalone.rst +++ b/docs/deploying/wsgi-standalone.rst @@ -97,9 +97,10 @@ localhost at port 8000, setting appropriate headers: proxy_pass http://127.0.0.1:8000/; proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } }