Skip to content

Commit

Permalink
Merge pull request #141 from aledbf/fix-backlog
Browse files Browse the repository at this point in the history
Add reuse port and backlog to port 80 and 443
  • Loading branch information
justinsb committed Jan 19, 2017
2 parents 28c6725 + 7fa5aec commit ac5b84c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ http {
{{ $zone }}
{{ end }}

{{ $backlogSize := .BacklogSize }}
{{ range $index, $server := .Servers }}
server {
server_name {{ $server.Hostname }};
listen [::]:80{{ if $cfg.UseProxyProtocol }} proxy_protocol{{ end }}{{ if eq $index 0 }} ipv6only=off{{end}}{{ if eq $server.Hostname "_"}} default_server{{end}};
listen [::]:80{{ if $cfg.UseProxyProtocol }} proxy_protocol{{ end }}{{ if eq $index 0 }} ipv6only=off{{end}}{{ if eq $server.Hostname "_"}} default_server reuseport backlog={{ $backlogSize }}{{end}};
{{/* Listen on 442 because port 443 is used in the stream section */}}
{{ 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 */}}
Expand Down

0 comments on commit ac5b84c

Please sign in to comment.