Last active
November 20, 2022 07:04
-
-
Save hgirish/01767ae017300bfc5a42 to your computer and use it in GitHub Desktop.
Find Remote IP Address in Coldfusion when Cloudflare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset remoteAddress = getHttpRequestData().headers["CF-Connecting-IP"] > | |
<cfif remoteAddress eq ''> | |
<cfset remoteAddress = getHttpRequestData().headers["X-Forwarded-For"] > | |
</cfif> | |
<cfif remoteAddress eq ''> | |
<cfset remoteAddress = cgi.REMOTE_ADDR > | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment