2

I have an 3 legged NGINX reverse proxy setup with External, Internal and DMZ networks.

NGINX has a reverse proxy server configured to listen on port 80 in the DMZ. I need to forward the request to another server via an upstream HTTP proxy, the request cannot be retrieved directly.

If I put the WEB proxy's IP address into upstream section - it sends "POST /DataService.svc HTTP/1.0" to http proxy and that obviously does not work.

Is it possible to rewrite $uri to include the host name in the request so it will look like "POST http://server.com/DataService.svc HTTP/1.0"

Should this work and how can I achieve this without installing squid etc...

Intra
  • 61
  • 9
  • why is it obvious that the first example won't work? what for sure will not work is `POST http://server.com/DataService.svc HTTP/1.0` as you are POSTing Data to a document called `http://server.com/DataServices.svc` - the Clients tells the Webserver the VirtualHost it needs via the HTTP-Host-Header, not in the GET or POST request. – r_3 Nov 28 '14 at 14:41
  • The upstream server is HTTP Proxy `When a client uses a proxy, it typically sends all requests to that proxy, instead of to the servers in the URLs. Requests to a proxy differ from normal requests in one way: in the first line, they use the complete URL of the resource being requested, instead of just the path. For example, GET http://www.somehost.com/path/file.html HTTP/1.0 That way, the proxy knows which server to forward the request to (though the proxy itself may use another proxy).` – Intra Dec 03 '14 at 01:39
  • Ended up installing tinyproxy bound to 127.0.0.1 (transparent mode, upstream proxy server configured), that solves the issue. Looks like it's not possible to achieve this result using just NGINX. – Intra Dec 04 '14 at 02:33

0 Answers0