I have a react app (simple frontend app) that in production is on a relative path (for instance suite.app.com/auth). Other apps are on different paths. So I need all requests for static files for this app to be routed via nginx to /auth. Basically this works fine from an nginx perspective but from a react perspective I need the paths to be relative:
In my package.json I have added "homepage": "./",
and in my index.html I have added <base href="/auth/">
So now when I load the files, I can see in the network tab of browser

which is what I expect. Static files relative. However in my server logs when I load the app I can see this occuring:
I.e something is not passing the request to the correct path. (FWIW the reason they are coming back with 200's there, is because there is a different app on the root so its actually loading the other apps files, not this ones.
Any tips of what might be occuring here would be great.
EDIT: Posting the Nginx config for the two endpoints. The
server {
listen 80;
server_name app.site.com;
add_header 'Referrer-Policy' 'origin';
location /auth {
proxy_pass http://authentication.internal.app/;
proxy_set_header Host authentication.internal.app;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $proxy_protocol_addr;
proxy_set_header X-Forwarded-For $proxy_protocol_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
}
location / {
proxy_pass http://dashboard.internal.app/;
proxy_set_header Host dashboard.internal.app;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $proxy_protocol_addr;
proxy_set_header X-Forwarded-For $proxy_protocol_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
}
}
