Explorar o código

'nginx-proxy/nginx.tmpl' ändern

Changed the https redirect to make LetsEncrypt work with ssl-Client Cert secured pages
hmetzner %!s(int64=7) %!d(string=hai) anos
pai
achega
354900e8f0
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      nginx-proxy/nginx.tmpl

+ 11 - 1
nginx-proxy/nginx.tmpl

@@ -198,7 +198,17 @@ server {
 	listen [::]:80 {{ $default_server }};
 	{{ end }}
 	access_log /var/log/nginx/access.log vhost;
-	return 301 https://$host$request_uri;
+	location /.well-known/acme-challenge/ {
+	    auth_basic off;
+	    allow all;
+	    root /usr/share/nginx/html;
+	    try_files $uri =404;
+	    break;
+	}
+
+	location / {
+	    return 301 https://$host$request_uri;
+    }
 }
 {{ end }}