From 37e4a0d00ec26f57d608c5b9b6645b4bde6968d6 Mon Sep 17 00:00:00 2001 From: Paulo Ragonha Date: Thu, 22 Jan 2015 14:37:10 -0200 Subject: [PATCH] fixes SSL support while mixing HTTPS and non-HTTPS services nginx was throwing the following error: `no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking` ref: https://github.com/jwilder/nginx-proxy/issues/74 --- nginx.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.tmpl b/nginx.tmpl index d373ce3..9d1f43c 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -126,16 +126,16 @@ server { } } +{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }} server { server_name {{ $host }}; listen 443 ssl; return 503; - {{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }} ssl_certificate /etc/nginx/certs/default.crt; ssl_certificate_key /etc/nginx/certs/default.key; - {{ end }} } +{{ end }} {{ end }} {{ end }}