I have an nginx server where I'd like to point any route that begins with /app
to a specific file. It's a single page app, so even /app/some/long/route
should just return the same index.html file.
location /app {
proxy_pass http://my-cdn-host.com/index.html;
}
I'm having 2 problems:
- I'm pretty sure that
/app/very/long/url
does a proxy_pass tohttp://my-cdn-host.com/index.html/app/very/long/url
which is not wanted - It's not clear to me based on the logs exactly what the proxied URL is, so I can't even fully confirm the point above.
$proxy_host
and$upstream_addr
don't have that full information
One final note: even though the file is http://my-cdn-host.com/index.html
, I'm unable to access it with just http://my-cdn-host.com/
. The index.html
needs to be the explicit path.
Is there a way I can serve a single remote file for my location? Thank you