From f4a0dca15b919a9d53379e6bc1f45d547fee6dea Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 13 Apr 2021 13:26:49 -0400 Subject: [PATCH] fix: scope return 301 in nginx config to allow proper letsencrypt usage --- plugins/nginx-vhosts/templates/nginx.conf.sigil | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/nginx-vhosts/templates/nginx.conf.sigil b/plugins/nginx-vhosts/templates/nginx.conf.sigil index 331bd5677..803878c6f 100644 --- a/plugins/nginx-vhosts/templates/nginx.conf.sigil +++ b/plugins/nginx-vhosts/templates/nginx.conf.sigil @@ -12,7 +12,10 @@ server { access_log {{ $.NGINX_ACCESS_LOG_PATH }}{{ if and ($.NGINX_ACCESS_LOG_FORMAT) (ne $.NGINX_ACCESS_LOG_PATH "off") }} {{ $.NGINX_ACCESS_LOG_FORMAT }}{{ end }}; error_log {{ $.NGINX_ERROR_LOG_PATH }}; {{ if (and (eq $listen_port "80") ($.SSL_INUSE)) }} - return 301 https://$host:{{ $.PROXY_SSL_PORT }}$request_uri; + include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; + location / { + return 301 https://$host:{{ $.PROXY_SSL_PORT }}$request_uri; + } {{ else }} location / {