According to my research, neither the unofficial F5XFFHttpModule nor the Advanced Logging Module for IIS7 will work in IIS10. Since IIS8.5, the enhanced IIS log has been used uniformly, which is the default log module in IIS10. In this module you can add custom fields to map the X-forward-for response header to get the client IP, but it doesn't allow you to map to the c-ip field. This is method 1.
Method 2, as a workaround, you can use the ARR helper to force c-ip to map x-forward-for. But I don't recommend you to do this, in my tests it was not stable, could cause the app pool to stop and crash for no reason, and not every request would record the client IP accurately.
If you has installed ARR3(must be ARR3) on server, please navigate to C:\Program Files\IIS\Application Request Routing
. Find requestrouterhelper_x64.msi
and click it to install, requestrouterhelper_x86.msi
for 32-bit system. Then it will auto create a ARR Helper folder in C:\Program Files\IIS
and add it into IIS module.
Then click ISAPI and CGI restrictions module on IIS, add the helper in it, like this:
Please Note: This method is not stable and may cause the problems mentioned above. I don't recommend you to use it. Please use method 1.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Bruce Zhang