Skip to content

Commit

Permalink
Merge pull request #34 from euank/nginx-ipv6ish
Browse files Browse the repository at this point in the history
nginx: also listen on ipv6
  • Loading branch information
aledbf authored Dec 21, 2016
2 parents 436ac9e + 8fe1efe commit f0762ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ http {
{{ $zone }}
{{ end }}

{{ range $server := .Servers }}
{{ range $index, $server := .Servers }}
server {
server_name {{ $server.Hostname }};
listen 80{{ if $cfg.UseProxyProtocol }} proxy_protocol{{ end }};
listen [::]:80{{ if $cfg.UseProxyProtocol }} proxy_protocol{{ end }}{{ if eq $index 0 }} ipv6only=off{{end}};
{{ if not (empty $server.SSLCertificate) }}listen 442 {{ if $cfg.UseProxyProtocol }}proxy_protocol{{ end }} ssl {{ if $cfg.UseHTTP2 }}http2{{ end }};
{{/* comment PEM sha is required to detect changes in the generated configuration and force a reload */}}
# PEM sha: {{ $server.SSLPemChecksum }}
Expand Down Expand Up @@ -332,7 +332,7 @@ http {
# Use the port 18080 (random value just to avoid known ports) as default port for nginx.
# Changing this value requires a change in:
# https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/nginx/command.go#L104
listen 18080 default_server reuseport backlog={{ .BacklogSize }};
listen [::]:18080 ipv6only=off default_server reuseport backlog={{ .BacklogSize }};

location {{ $healthzURI }} {
access_log off;
Expand Down Expand Up @@ -407,7 +407,7 @@ stream {
{{ buildSSPassthroughUpstreams $backends .PassthrougBackends }}

server {
listen 443;
listen [::]:443 ipv6only=off;
{{ if $cfg.UseProxyProtocol }}proxy_protocol on;{{ end }}
proxy_pass $stream_upstream;
ssl_preread on;
Expand Down

0 comments on commit f0762ba

Please sign in to comment.