0

Have a Nginx box on the DMZ that is to proxy trough to a IIS box on the LAN.

I can get to the home page OK via the Nginx box however after navigating further it seems to re-direct rather than proxy.

Is there additional config needed either on the IIS or Nginx side?

server {
        listen 80;
    listen 443;

    server_name internal.lan.com;

    location / {
        proxy_pass http://internal.lan.com;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_redirect off;

    }
}

1 Answer 1

0

That depends on how the website builds the links on the pages.
If they are absolute paths (http://internal.lan.com/page.html) rather then relative paths (/page.html) then you need to rewrite them:

The module ngx_http_sub_module module is required to be build into the binary. Using --with-http_sub_module in the ./configure command.
More info: http://nginx.org/en/docs/http/ngx_http_sub_module.html

sub_filter 'http://internal.lan.com/'  'https://$host/';
sub_filter_once off;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .