NGINX only for forwarding to LAN

Francis Daly francis at daoine.org
Wed Dec 11 20:21:08 UTC 2019


On Wed, Dec 11, 2019 at 07:42:26AM -0500, pixel24 wrote:

Hi there,

> NGINX on the IPfire should now forward all requests directed to
> gw.mydomain.de to the server 192.168.xx.5 (and turück)
> 
> and requests addressed to cloud.mydomain.com to LAN: 192.168.xx.6

Typed, rather than tested and copy-pasted, but the following looks like
it should work for the simple case:

  server {
    server_name gw.mydomain.com;
    location / {
      proxy_pass http://192.168.xx.5;
    }
  }
  server {
    server_name cloud.mydomain.com;
    location / {
      proxy_pass http://192.168.xx.6;
    }
  }

Depending on what the "upstream" (LAN) web servers do, you might need
some more directives there too.

If you can report a specific problem -- such as "when I do 'curl -i
http://gw.mydomain.com/dir', I get a 301 to http://192.168.xx.5/dir/
but I want a 301 to http://gw.mydomain.com/dir/", then someone may be
able to offer an improvement.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list