I'm using flask + gunicorn for my website. and I'm using nginx for reverse proxy only. and set up as nginx config flask proxy setups. I haven't added location /static info in nginx.conf file. so all static files are supposed to be handled by flask itself. but when visiting from public network, it can't load css files. I tried to run flask + gunicorn alone without nginx, it worked well. so why can't flask serve static files by itself behind nginx?
Then I added location /statis info into nginx config file so that nginx may serve static file instead. Still can't load static files. when i looked into error log. it shows
"/var/www/my_project_folder/static/css/style.css" failed (2: No such file or directory), client: 61.152.126.178, server: _, request: "GET /static/css/style.css HTTP/1.1", host: "47.97.209.250", referrer: "http://47.97.209.250"
the path in the error message actually is correct. the last method I tried is to run all script and service under root and chmod my_project to 666. still no success.
I searched on stackoverflow, but no one mentioned the issue that flask itselft can't serve static files behind nginx.
So i hope anyone have any idea or clue about this. and nginx serving issue
Thank