Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

HTTP 403 when using proxy_pass with upstream server block (no replies)

$
0
0
When I reverse proxy to a public echo service, I can make this work using
the server name directly, but I get an HTTP 403 if I use an upstream server
block pointing to the same domain.

Simple Scenario:
```
location / {
proxy_pass http://rve.org.uk/utils/echo-nocache.cgi/freg/;
}
```

Upstream scenario:
```
upstream app_server {
server rve.org.uk:80 http://rve.org.uk/;
}

server {
[...]
location / {
proxy_pass http://app_server/utils/echo-nocache.cgi/freg/;
}
```

Following a rejected defect report (see https://trac.nginx.org/ng
inx/ticket/1155#comment:1 for full nginx.conf) I have tried using:

proxy_set_header Host $proxy_host;
proxy_set_header Host $http_host;
proxy_set_header Host $host;
proxy_set_header Host rev.org.uk;

None of them work in the upstream scenario, only the first, $proxy_host
works for the simple scenario.

I have tested this on both nginx for Windows and the default Docker Hub
image (nginx/1.11.6), and had identical results.

Can anyone please tell me what I am doing wrong?

Thanks -

Francis.
--
*Multitasking creates a dopamine-addiction feedback loop, effectively
rewarding the brain for losing focus and for constantly searching for
external stimulation* - Daniel Levitin, The Organised Mind
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>