[Flask] flask url_for / nginx proxy_pass

Pascal patatetom at gmail.com
Fri Jun 10 05:52:57 EDT 2016


hello,

my flask app (flaskbb <https://github.com/sh4nks/flaskbb>) is listening on
127.0.0.1:8765 and is ok when accessed directly with http://127.0.0.1:8765/.

when accessed through nginx with http://mywebserver/flaskbb/, all links are
broken because /flaskbb is missing in the url (eg. src="/css/..." and not
src="/flaskbb/css/...").

I currently bypasses the problem by modifying the templates, but it's not
clean :-(

how can I solve this problem ?

note that nginx directive is location /flaskbb/ { proxy_pass
http://127.0.0.1:8765/; } and I can't play with virtual-server/dns.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160610/4b07a01c/attachment.html>


More information about the Flask mailing list