soooo close: nginx gunicorn flask directory stripped from links

Brian Scott biscotty666 at gmail.com
Fri Sep 16 08:03:21 UTC 2022


Wow that looks promising. Can't try until tomorrow because it's 2am but I'll try first thing tomorrow. From a best practices point of view would one solution be better than the other assuming both work? The second suggestion seems more straight-forward and avoids patches/fixes which is a good thing in general.

⁣Get BlueMail for Android ​

On Sep 16, 2022, 1:49 AM, at 1:49 AM, Francis Daly <francis at daoine.org> wrote:
>On Fri, Sep 16, 2022 at 01:22:46AM -0600, Brian Carey wrote:
>
>Hi there,
>
>> I'm very close to getting my flask app properly reverse-proxied by
>nginx.
>
>If your nginx config is correct, then it might be that the upstream
>/ backend service (the flask app, in this case) does not like being
>reverse-proxied (to a different "sub-directory"),
>
>> I can access and use my app successfully at http://127.0.0.1:8000.
>> 
>> I can get to my main page at http://my.domain/app. If I specifically
>enter
>> the url of a sub-directory/page I can get there, for example
>> http://my.domain/app works and http://my.domain/app/home works.
>
>> Hovering over the link it points to http://my.domain/home instead of
>> http://my.domain/app/home.
>
>Does https://pypi.org/project/flask-reverse-proxy-fix/ apply in your
>case?
>
>That page links to a 404 page, where the original content appears to be
>at
>https://web.archive.org/web/20131129080707/http://flask.pocoo.org/snippets/35/
>
>You can possibly / potentially avoid all of that, if you are happy
>to deploy your app at http://127.0.0.1:8000/app/ instead of at
>http://127.0.0.1:8000/ -- in that case, all of the "local" links will
>be the same in both the direct and reverse-proxied cases, so only the
>hostname/port would need adjusting. (Which is usually more
>straightforward.)
>
>(I'm presuming that it is possible to deploy a flask app somewhere
>other
>than the root of the web service.)
>
>Good luck with it,
>
>	f
>-- 
>Francis Daly        francis at daoine.org
>_______________________________________________
>nginx mailing list -- nginx at nginx.org
>To unsubscribe send an email to nginx-leave at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220916/ad6867ee/attachment.htm>


More information about the nginx mailing list