讓iis記錄nginx反向代理的真實(shí)ip
一、設(shè)置X-Forwarded-For段
nginx配置示例:
{
location
{
...
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
...
}
}
二、在iis站點(diǎn)上安裝isapi filter
在f5的開發(fā)論壇上找到的,按開發(fā)者的話說,是為了解決iis放在f5后記錄不到用戶ip的問題,管他前端是f5還是nginx還是squid還是haproxy,都可以用。
裝完之后重啟下iis即可。
https://devcentral.f5.com/weblogs/Joe/archive/2009/08/19/x_forwarded_for_log_filter_for_windows_servers.aspx
安裝方法,從官方文檔復(fù)制了過來的,大家看看咯。
Installation
Follow these steps to install the filter.
Download and unzip the F5XForwardedFor.zip distribution.
Copy the F5XForwardedFor.dll file from the x86\Release or x64\Release directory (depending on your platform) into a target directory on your system. Let's say C:\ISAPIFilters.
Ensure that the containing directory and the F5XForwardedFor.dll file have read permissions by the IIS process. It's easiest to just give full read access to everyone.
Open the IIS Admin utility and navigate to the web server you would like to apply it to.
For IIS6, Right click on your web server and select Properties. Then select the "ISAPI Filters" tab. From there click the "Add" button and enter "F5XForwardedFor" for the Name and the path to the file "c:\ISAPIFilters\F5XForwardedFor.dll" to the Executable field and click OK enough times to exit the property dialogs. At this point the filter should be working for you. You can go back into the property dialog to determine whether the filter is active or an error occurred.
For II7, you'll want to select your website and then double click on the "ISAPI Filters" icon that shows up in the Features View. In the Actions Pane on the right select the "Add" link and enter "F5XForwardedFor" for the name and "C:\ISAPIFilters\F5XForwardedFor.dll" for the Executable. Click OK and you are set to go.
I'd love to hear feedback on this and if there are any other feature request, I'm wide open to suggestions. The source code is included in the download distribution so if you make any changes yourself, let me know!
Good luck and happy filtering!
相關(guān)文章
用戶IIS APPPOOL\DefaultAppPool登錄失敗的解決方法
這篇文章主要為大家詳細(xì)介紹了用戶IIS APPPOOL\DefaultAppPool登錄失敗的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04
配置win2008防火墻 允許被Ping的設(shè)置方法
出于安全因素考慮,在 Windows Server 2008 上是不允許從外部對其執(zhí)行 Ping 指令的2010-05-05
windows下Graphviz安裝及入門教程的實(shí)現(xiàn)方法
這篇文章主要介紹了windows下Graphviz安裝及入門教程的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09
由注冊表引起的 I/O 操作發(fā)生了不可恢復(fù)的錯(cuò)誤修復(fù)方法
由注冊表引起的 I/O 操作發(fā)生了不可恢復(fù)的錯(cuò)誤。 注冊表將不能讀取、寫出或刷新包含注冊表系統(tǒng)圖像的其中一個(gè)文件2012-06-06
windows服務(wù)器指定IP地址才能進(jìn)行遠(yuǎn)程訪問桌面設(shè)置方法
這篇文章主要介紹了windows服務(wù)器指定IP地址才能進(jìn)行遠(yuǎn)程訪問桌面設(shè)置方法,需要的朋友可以參考下2018-05-05
windows?server?2012安裝FTP并配置被動(dòng)模式指定開放端口
本文主要介紹了windows?server?2012安裝FTP并配置被動(dòng)模式指定開放端口,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-06-06
win2003服務(wù)器的一些安全設(shè)置(彩票)
這篇文章主要介紹了win2003服務(wù)器的一些安全設(shè)置(彩票),一些不錯(cuò)的地方,當(dāng)然也可以使用安全狗設(shè)置,需要的朋友可以參考下2016-01-01

