I am new to Nginx and Gunicorn....
I am trying to serve flask app on certain prefix....
ex: https://myweb.com/flask/prefix/
everything works fine except it is not loading static files......
my nginx site configuration looks like below
location /flask/prefix/ {
include proxy_params;
proxy_pass http://unix:/home/user/flask_config/flask_socket_file.sock:/;
}
when I checked the network section by using Firefox developer tool I found that it is loading home page path /
for static files instead of this /flask/prefix
....
Example:
/static/image.png (i.e https://myweb.com/static/image.png)
but it suppose to be /flask/prefix/static/image.png (i.e https://myweb.com/flask/prefix/static/image.png).
However I tried to remove :/
at the end of proxy_pass
statement... it ended with 501 error....
Please let me know what I am doing wrong....
I followed steps to configure Flask app with Nginx from Here