Ngnix + Gunicorn + Flask: How to figure out the real base URL Ngnix + Gunicorn + Flask: How to figure out the real base URL flask flask

Ngnix + Gunicorn + Flask: How to figure out the real base URL


I think you should define SERVER_NAME variable in flask config: http://flask.pocoo.org/docs/0.10/config/

After that domain name should be accessible by request.url_root or request.headers['Host']


You must add the line

include uwsgi_params;

in your nginx config.uwsgi_params file