Questions tagged [x-forwarded-for]

Use for questions regarding X-Forwarded-For, a HTTP header used by HTTP proxies to send the originating request's IP address.

The X-Forwarded-For (XFF) header is a de-facto standard header for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or a load balancer.

This header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive information, such as the IP address of the client. Therefore the user's privacy must be kept in mind when deploying this header.

A standardized version of this header is the HTTP Forwarded header.

X-Forwarded-For is also an email-header indicating that an email-message was forwarded from another account.


Resource:

MDN web docs

76 questions
21
votes
5 answers

How to configure nginx X-Forwarded-Port to be the originally request port

I am using nginx in a standard reverse proxy scenario, to pass all requests to /auth to another host, however I'm trying to use non-standard ports. My end goal is to have the X-Forwarded-Port header set to the port that the request comes in on. Here…
10
votes
4 answers

FastAPI (starlette) get client real IP

I have an API on FastAPI and i need to get the client real IP address when he request my page. I'm ty to use starlette Request. But it returns my server IP, not client remote IP. My code: @app.post('/my-endpoint') async def my_endpoint(stats: Stats,…
Nataly Firstova
  • 247
  • 2
  • 7
10
votes
4 answers

Drawback of using ELB. Is Nginx the best solution? (ELB vs Nginx)

Disclaimer: This topic is for HTTP Traffic (on Linux Platform). May be there is a good solution with ELB (with reasonable price for everyone) for the problem below. But so far i can not find any. That's why i need expert advices. Problem: I've been…
夏期劇場
  • 15,969
  • 40
  • 121
  • 208
7
votes
0 answers

What is the rationale behind apache's two remoteip directives; RemoteIPTrustedProxy vs remoteipinternalproxy

RemoteIPTrustedProxy does not accept internal addresses like 10.0.0.0/8. remoteipinternalproxy accepts all addresses. When should you use one or the other. The rationale is, as far as I can tell, not retrievable from Apache httpd's documentation.
hbogert
  • 3,518
  • 4
  • 18
  • 36
5
votes
3 answers

Azure API Management - How to get original IP when APM is behind WAF

We have below technical stack Imperva WAF API Management WebApi in WebApp This is current implementation Client IPs are authenticated at WAF level WAF IPs are whitelisted at APIM APIM IP is whitelisted at WebApp level Everything is working fine…
5
votes
0 answers

Is there any way to force Segment JS client to use IPv6 instead of IPv4?

I have a device which has both IPv4 and IPv6 address. In my rails application, the request comes through Cloudflare, and the IP address extracted from X-Forwarded-For is IPv6 address. But when I sent a tracking event from JS client, it uses IPv4 by…
4
votes
1 answer

Tomcat: 'X-Forwarded-For' doesn't work with load balancer

We are currently working on a redundant server setup (2 servers + 1 load balancer) using Tomcat 7 update 76. To fulfill the logging requirements of our company, we are trying to get the IP of the remote server, that actually sends the request, not…
Nkls155
  • 223
  • 3
  • 11
4
votes
0 answers

Alternative for IIS Advanced Logging functionality in IIS 10

I am trying to configure my server to overwrite the c-ip value with the real user IP provided by the Load Balancer within the X-Forwarded-For header. This was possible within IIS 7.0 and IIS 8.5 using the Advanced Logging…
3
votes
0 answers

How do I access X-Forwarded-For header for Spring Boot app in AWS Elastic Beanstalk?

I have the following to print out all the request headers. It is not printing out X-Forwarded-For header. The documentation states that Elastic Beanstalk does forward the real IP of the…
Chloe
  • 21,167
  • 37
  • 143
  • 289
3
votes
0 answers

Attribute provided with invalid value in Google Apps Script

Problem I want to communicate with api while changing IP address, because the server restricts IP address. So, I add X-Forwarded-For header with UrlFetchApp. However, I get an error "Attribute provided with invalid value:…
RyosukeOK
  • 417
  • 6
  • 17
3
votes
2 answers

How to assign UrlFetchApp with basic authorization to button?

I created function in Google Apps Script, that works well when I run it in Google Apps Script. Output data returns to Google Sheets. function testFunction11() { var rng = SpreadsheetApp.getActiveRange(); var encodedAuthInformation =…
3
votes
0 answers

AWS ELB Logging to S3 with X-Forwarded-For as Client IP

We have a DDoS layer (Project Shield) that forwards public requests to our AWS Application Load Balancer (ALB). Our ALB is has access logging enabled (to an S3 Bucket). Outside of setting up the bucket, setting permissions and enabling this feature,…
2
votes
1 answer

no X-Forwarded-For with Traefik 2 on bare metal Kubernetes with ClusterIP Service and kube-keepalive-vip

My setup is a bare metal cluster running Kubernetes 1.17. I'm using Traefik 2(.3.2) as a reverse proxy and to get failover for my machines I use kube-keepalive-vip [1]. --- apiVersion: v1 kind: ConfigMap metadata: name: kube-keepalived-vip-config …
razr
  • 722
  • 7
  • 18
2
votes
0 answers

Apache proxyPass with x-forwarded-for not working

I have an issue with Apache X-Forwarded-For. Here is the scenario I have a server which will forward the request to an Apache Server. And the Apache server has multiple Proxy forwards. What the issue i am facing now is even though I am able to…
2
votes
1 answer

How to set X-Forwarded-For in Node.Js app while calling with axios

Okay, I just got an opportunity to work in nodejs, where I am using axios library to fetch the data from third party url. Everything was working very smoothly until it was deployed to staging ENV. Similar issue I got while working with rails, and…
1
2 3 4 5 6