I have nginx (: 80) and an upstream server (: 8080) running on my machine.
- I want to proxy all requests in / assets / (*.?) To the upstream / upstream / $ 1 folder.
- The upstream server redirects (302) / upstream / file_id to /real/file/location.ext
Here is my code:
location /assets/ { rewrite ^/assets/(.*) /upstream/$1 break; proxy_pass http://127.0.0.1:8000; }
This seems to work, but on the client side I get a redirected location:
http://myserver.com/real/file/location.ext
I want to hide it so that it stays:
http:
The idea is for the upstream server to find the real location of the file, but let nginx serve the file without giving away its real location. Is it possible?
source share