Nginx proxy - Static files #2425
-
So, I am trying to use Nginx as a reverse proxy. However, this proxy is at "https://scot-survivor.space/plan", while it forwards correctly, I can't work out how to forward static files. Currently, my Nginx config is this:
Using burp suite, I saw that the "referer" header may be able to be used in order to check if it's being referred by I could ctrl+f the HTML files so that all resource requests go to Let me know if you need my Plan config too Thank you for all your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please refer to https://github.com/plan-player-analytics/Plan/wiki/External-Webserver-use:-Reverse-proxy#nginx-reverse-proxy and nginx documentation. Any location should end with If you use subdirectory the proxy_pass needs to end with server {
listen 80;
server_name scot-survivor.space;
location /plan/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8804/;
}
} Your question is confusing me since you want to direct traffic to Plan webserver but also serve static files for Plan even though Plan webserver serves those. nginx has try_files directive for serving static files https://linuxhint.com/use-nginx-try_files-directive/ and there's a possibility of having nginx try address and then try static files or other way around by defining |
Beta Was this translation helpful? Give feedback.
Please refer to https://github.com/plan-player-analytics/Plan/wiki/External-Webserver-use:-Reverse-proxy#nginx-reverse-proxy and nginx documentation.
Any location should end with
/
if using it as a reverse proxy directory.If you use subdirectory the proxy_pass needs to end with
/
as well - egYour question is confusing me since you want to direct traffic to Plan webserver but also serve static files for Plan even though Plan webserver serves those.
nginx has try_files d…