Skip to content

Real IP not showing up in remote_addr #12200

@afares-hims

Description

@afares-hims

What happened:

We have this setup:

User -> Fastly -> Ingress-NGINX -> Backend

Ingress-NGINX is configured as follows:

  use-proxy-protocol: "true"
  enable-real-ip: "true"
  proxy-real-ip-cidr: "23.235.32.0/20,43.249.72.0/22,103.244.50.0/24,103.245.222.0/23,103.245.224.0/24,104.156.80.0/20,140.248.64.0/18,140.248.128.0/17,146.75.0.0/17,151.101.0.0/16,157.52.64.0/18,167.82.0.0/17,167.82.128.0/20,167.82.160.0/20,167.82.224.0/20,172.111.64.0/18,185.31.16.0/22,199.27.72.0/21,199.232.0.0/16"

Logs are showing Fastly's IP as remote_addr instead if user IP.

What you expected to happen:

It should be user's IP.

NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):


NGINX Ingress controller
Release: v1.10.1
Build: 4fb5aac
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.25.3


Kubernetes version (use kubectl version):
Client Version: v1.28.13
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.13-eks-a737599

Environment:

  • Cloud provider or hardware configuration: AWS EKS
  • OS (e.g. from /etc/os-release): Alpine Linux v3.19
  • Kernel (e.g. uname -a): Linux ingress-nginx-controller-public-7964cc9745-pmvv4 6.1.109 Basic structure  #1 SMP PREEMPT_DYNAMIC Sat Sep 28 21:21:49 UTC 2024 x86_64 Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as a support question.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions