Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

[nginx-ingress-controller] Fix duplicated real_ip_header #1317

Merged
merged 1 commit into from
Jul 5, 2016

Conversation

aledbf
Copy link
Contributor

@aledbf aledbf commented Jul 5, 2016

fixes #1316

@@ -17,8 +17,14 @@ events {

http {
{{/* we use the value of the header X-Forwarded-For to be able to use the geo_ip module */}}
{{ if $cfg.useProxyProtocol -}}
set_real_ip_from {{ $cfg.proxyRealIpCidr }};
real_ip_header proxy_protocol;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my own eductaion, this actually sets the ip on the forwarded packet from the proxy protocol ascii block, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@bprashanth
Copy link

I thought we were doing some static checking of the config before reload (and not reloading if the config was invalid)? if that's not the case, can you please file a follow up bug. LGTM.

@bprashanth bprashanth merged commit cac6193 into kubernetes-retired:master Jul 5, 2016
@aledbf
Copy link
Contributor Author

aledbf commented Jul 5, 2016

If reload returns an error nginx continues using the previous version

@bprashanth
Copy link

ah so this won't cause downtime right? just a broken feature

@aledbf
Copy link
Contributor Author

aledbf commented Jul 5, 2016

exactly. This is an issue when you start with an error in nginx.conf not in a reload

@bprashanth
Copy link

bprashanth commented Jul 5, 2016

hmm, we can probably work around that too by persisting the last known good template in a volume or configmap, reading on boot up, and only overwriting it on success reload. But a better first step would be an e2e for the nginx controller :)

@aledbf aledbf deleted the fix-real-ip branch July 8, 2016 20:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[nginx-ingress-controller] real_ip_header is duplicate when useProxyProtocol is enabled
3 participants