How do I restore original visitor IP with IIS?

This support page has a link to technical resources:
https://support.cloudflare.com/hc/en-us/articles/203734070-How-do-I-restore-original-visitor-IP-with-IIS-7-

But the download link for the IIS Module does not work:
https://www.cloudflare.com/technical-resources/#iis

Where can the IIS module be downloaded?

Thanks

This looks to be the same module but can’t guarantee it… https://devcentral.f5.com/articles/x-forwarded-for-http-module-for-iis7-source-included It looks to do the same thing if it isn’t, but haven’t tested it.

Ideally you’re running a version of IIS that is Windows 2012 R2 or later and then you can just make the change in IIS directly.

Thank you

In case you’re using CFML on IIS:

<!--- GET THE END USER IP --->
<cftry>
	<cfset session.ipAddress = GetHttpRequestData().headers['CF-Connecting-IP']>
	<cfcatch>
		<cfset session.ipAddress = cgi.remote_addr>
	</cfcatch>
</cftry>

That will set a session variable of the Cloudflare connecting ip. If that is not found, it defaults to the CGI variable remote_addr.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.