-
Notifications
You must be signed in to change notification settings - Fork 2k
Set value of $remote_addr
to client IP when TLSPassthrough and Proxy Protocol are enabled
#3341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## main #3341 +/- ##
=======================================
Coverage 51.56% 51.56%
=======================================
Files 60 60
Lines 16678 16678
=======================================
Hits 8600 8600
Misses 7788 7788
Partials 290 290 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
$remote_addr
to client IP when TLSPassthrough and Proxy Protocol are enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Hi @coolbry95 - We actually asked the F5 Support for this change a couple of weeks ago. I've tested today for >10hrs and didn't get this feature working. X-Real-IP remains unset / empty. I've confirmed this behaviour on our side with proxy_protocol enabled and disabled using a fairly default NGiNX as upstream backend (with self-signed certs) and a tool (without NGiNX, to rule the config there out) to just send all set request headers as a repsonse. We're using the Ingress Controller with Helm, here's a part of our configuration: apiVersion: charts.nginx.org/v1alpha1
kind: NginxIngress
metadata:
name: nginx-ingress
spec:
controller:
affinity: {}
appprotect:
enable: true
appprotectdos:
debug: false
enable: false
maxDaemons: 0
maxWorkers: 0
memory: 0
config:
annotations: {}
entries:
set-real-ip-from: 10.0.0.0/16
customPorts: []
defaultTLS:
secret: ""
enableCertManager: false
enableCustomResources: true
enableLatencyMetrics: false
enableOIDC: true
includeYear: false
enablePreviewPolicies: false
enableSnippets: false
enableTLSPassthrough: true
extraContainers: []
globalConfiguration:
create: false
spec: {}
healthStatus: true
healthStatusURI: /*redacted*-health
hostNetwork: false
image:
pullPolicy: Always
repository: image-registry.openshift-image-registry.svc:5000/*redacted*-services/nginx-plus-ingress
tag: 3.0.1_s2023.01.26-1_t2023.02.01-1
lifecycle: {}
customConfigMap: ""
ingressClass: nginx
initContainers: []
kind: deployment
logLevel: 2
nginxDebug: false
nginxReloadTimeout: 60000
nginxStatus:
allowCidrs: 127.0.0.1
enable: true
port: 8080
nginxplus: true
nodeSelector: {}
pod:
annotations: {}
extraLabels: {}
priorityClassName: openshift-user-critical
readyStatus:
enable: true
port: 8081
replicaCount: 1
reportIngressStatus: #review later
annotations: {}
enable: true
enableLeaderElection: true
ingressLink: ""
resources:
requests:
cpu: 100m
memory: 128Mi
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
create: true
customPorts: []
externalIPs: []
externalTrafficPolicy: Local
extraLabels: {}
httpPort:
enable: true
port: 80
targetPort: 80
httpsPort:
enable: true
port: 443
targetPort: 443
loadBalancerIP: ""
loadBalancerSourceRanges: []
name: nginx-ingress
type: LoadBalancer
serviceAccount:
imagePullSecretName: ""
setAsDefaultIngress: false
terminationGracePeriodSeconds: 30
tolerations: []
volumeMounts: []
volumes: []
watchNamespace: ""
wildcardTLS:
secret: null
nginxServiceMesh:
enable: false
enableEgress: false
prometheus:
create: true
port: 9113
scheme: http
secret: ""
disableIPV6: false
rbac:
create: true For the Upstream:
Transport Server:
Is there any additional configuration needed that I'm missing? Kind regards, |
Proposed changes
This change updates the nginx plus and open source templates to allow the
set-real-ip-from
directive to be set in the server block for the stream context when proxy_protocol is enabled.Checklist
Before creating a PR, run through this checklist and mark each as complete.