I'm new to nginx and I need to setup a reverse proxy. Most things are loading except for a few images.
my server is "bar:7081"
I have no control over foo:8088's webpage
Here's what I have:
location / {
proxy_set_header Host $host;
proxy_set_header Referer $http_referer;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://foo:8088/;
}
For lack of a better tool, I'm using chrome and firefox's f12 debugger...
When the page loads, I realize it's requesting this resource: http://bar:7081/api/proxy/get?url=http://foo:8088/images/image123.jpg
Of course, the client cannot access foo:8088, so I see a 502 bad gateway for: http://foo:8088/images/image123.jpg
Is there a way I can redirect the request? Thank you!