You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application is behind a reverse proxy, and it cannot access the client IP. All the application sees is the IP from wrangler, because it doesn't add CF-Connecting-IP, nor does it append the client IP to X-Forwarded-For.
Feature request
Have header CF-Connecting-IP available. Or:
Append the client IP to X-Forwarded-For. Or:
Have a way to access the client IP, for example, it can be done via request.socket.remoteAddress
Background
We (GitLab) need a way to access the client IP when running wrangler for end-to-end tests. We do not want to deploy it to Cloudflare in order to run end-to-end tests.
This is needed for the end-to-end tests because the application which wrangler is talking to is behind another reverse proxy, and given this the application sees only the wrangler IP, not the actual client IP. This looks like this:
We want wrangler to append the client IP in X-Forwarded-For header and configure wrangler's IP as a trusted proxy, so that the application can find the real IP from X-Forwarded-For.
If CF-Connecting-IP is always available and can be trusted, then we can use that as well.
The main point is that we need to have a way to access the client IP, so that we can test features with regard to restricting IP. At the moment all IPs we can see are from wrangler itself, which means we cannot test this.
Workaround
We can potentially run another Nginx in front of wrangler to append the IP to X-Forwarded-For, like this:
Problem statement
The application is behind a reverse proxy, and it cannot access the client IP. All the application sees is the IP from
wrangler
, because it doesn't addCF-Connecting-IP
, nor does it append the client IP toX-Forwarded-For
.Feature request
CF-Connecting-IP
available. Or:X-Forwarded-For
. Or:request.socket.remoteAddress
Background
We (GitLab) need a way to access the client IP when running
wrangler
for end-to-end tests. We do not want to deploy it to Cloudflare in order to run end-to-end tests.This is needed for the end-to-end tests because the application which
wrangler
is talking to is behind another reverse proxy, and given this the application sees only thewrangler
IP, not the actual client IP. This looks like this:We want wrangler to append the client IP in
X-Forwarded-For
header and configurewrangler
's IP as a trusted proxy, so that the application can find the real IP fromX-Forwarded-For
.If
CF-Connecting-IP
is always available and can be trusted, then we can use that as well.The main point is that we need to have a way to access the client IP, so that we can test features with regard to restricting IP. At the moment all IPs we can see are from
wrangler
itself, which means we cannot test this.Workaround
We can potentially run another Nginx in front of
wrangler
to append the IP toX-Forwarded-For
, like this:But due to all the complexity involved with this, it would be nice to avoid needing to do this, just for accessing the client IP.
References
The text was updated successfully, but these errors were encountered: