Skip to content

Commit 5f6fdca

Browse files
authored
Merge pull request #39 from felixbuenemann/fix-default-vhost-ssl-config
fix(router) add missing ssl config in default host
2 parents e3c61f2 + b276068 commit 5f6fdca

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nginx/config.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,27 @@ http {
187187
server {
188188
listen 8080 default_server reuseport{{ if $routerConfig.UseProxyProtocol }} proxy_protocol{{ end }};
189189
listen 6443 default_server ssl {{ if $routerConfig.HTTP2Enabled }}http2{{ end }} {{ if $routerConfig.UseProxyProtocol }}proxy_protocol{{ end }};
190-
190+
191191
# set header size limits
192192
{{ if $routerConfig.HTTP2Enabled }} http2_max_header_size {{ $routerConfig.HTTP2MaxHeaderSize }}; {{ end }}
193193
{{ if $routerConfig.HTTP2Enabled }} http2_max_field_size {{ $routerConfig.HTTP2MaxFieldSize }}; {{ end }}
194194
195195
set $app_name "router-default-vhost";
196-
{{ if $routerConfig.PlatformCertificate }}
197196
ssl_protocols {{ $sslConfig.Protocols }};
197+
{{ if ne $sslConfig.Ciphers "" }}ssl_ciphers {{ $sslConfig.Ciphers }};{{ end }}
198+
ssl_prefer_server_ciphers on;
199+
{{ if $routerConfig.PlatformCertificate }}
198200
ssl_certificate /opt/router/ssl/platform.crt;
199201
ssl_certificate_key /opt/router/ssl/platform.key;
200202
{{ else }}
201-
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
202203
ssl_certificate /opt/router/ssl/default/default.crt;
203204
ssl_certificate_key /opt/router/ssl/default/default.key;
204205
{{ end }}
206+
{{ if ne $sslConfig.SessionCache "" }}ssl_session_cache {{ $sslConfig.SessionCache }};
207+
ssl_session_timeout {{ $sslConfig.SessionTimeout }};{{ end }}
208+
ssl_session_tickets {{ if $sslConfig.UseSessionTickets }}on{{ else }}off{{ end }};
209+
ssl_buffer_size {{ $sslConfig.BufferSize }};
210+
{{ if ne $sslConfig.DHParam "" }}ssl_dhparam /opt/router/ssl/dhparam.pem;{{ end }}
205211
{{ if ne $routerConfig.ReferrerPolicy "" }}
206212
add_header Referrer-Policy {{ $routerConfig.ReferrerPolicy }};
207213
{{ end }}

0 commit comments

Comments
 (0)