I am no expert in nginx, so sorry if any information is missing or not complete.
I have a website running under http://server-ip:3000/abc/xyz. This website also loads some assets from http://server-ip:3000/assets, but also some from http://server-ip:3000/abc/xyz/data
I now want to map mydomain.tld to http://server-ip:3000/abc/xyz
Therefore i have these locations:
location / {
proxy_pass http://upstream123/abc/xyz/;
}
location ~* /assets {
proxy_pass http://upstream123;
}
I assume I also have to map the data folder as an own location, because the contents of it wont be loaded (404) when accessing via the domain:
location ~* /data {
proxy_pass http://upstream123/abc/xyz/data;
}
I do all this via OPNsense and at first it accepted this and everything. But it led to some problems and when trying to reload everything and testing the nginx configuration, it tells me:
nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /usr/local/etc/nginx/nginx.conf:4532
I assume the problem is, that with the root (/) location, it somehow already refers to a deeper path, which then leads to problems when accessing path further down?
proxy_pass http://upstream123/data;
does not work, I tried this already
I hope I was able to explain the problem detailed enough.
Thanks
nginx -t
and/xyz/
should be/xyz
nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /usr/local/etc/nginx/nginx.conf:4532
location ~* /data {
proxy_pass http://upstream123/abc/xyz/data;
```