Передача реального IP через Nginx на MS IIS сервер

RockerMan nginx-forum на forum.nginx.org
Чт Сен 7 08:20:24 UTC 2017


Добрый день

Есть nginx, работающий в качестве реверс-прокси. За ним стоит MS IIS. У него
в логах запросы от клиента идут не от внешнего клиентского IP адреса, а от
адреса Nginx. В настройках nginx проброс реального IP прописан:
-
        location / {
            proxy_pass https://*.*.*.*/clientproxy/;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For
$proxy_add_x_forwarded_for,$remote_addr;
            }
-
В случае Apache в качестве бэкенд сервера рекомендуют на нем установить и
настроить:
-
Forwarding real remote IP from nginx to apache actually requires
mod_remoteip module installed & enabled in httpd.conf on the apache side.
Required proxy_set_header options in the server block:
server {
    ...
    proxy_set_header    X-Real-IP        $remote_addr;
    proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
    ...
}

On the apache side you should enable the required module with:
LoadModule remoteip_module modules/mod_remoteip.so

and set this directives:
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy 127.0.0.1

replace 127.0.0.1 with your nginx IP if needed...
-

Знатоки IIS, подскажите плз, есть у него аналогичный модуль? и как его
настроить, если такой имеется?

Спасибо.

Posted at Nginx Forum: https://forum.nginx.org/read.php?21,276283,276283#msg-276283



Подробная информация о списке рассылки nginx-ru