Welcome! Log In Create A New Profile

Advanced

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

September 07, 2017 04:20AM
Добрый день

Есть 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, подскажите плз, есть у него аналогичный модуль? и как его настроить, если такой имеется?

Спасибо.
Subject Author Posted

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

RockerMan September 07, 2017 04:20AM

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

Илья Шипицин September 07, 2017 05:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready