From 20ae2707362ac2e6c656b4d22b702235080b52a8 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 6 Aug 2023 13:29:05 +0200 Subject: [PATCH] Fix virtualconf template --- wo/cli/templates/virtualconf.mustache | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/wo/cli/templates/virtualconf.mustache b/wo/cli/templates/virtualconf.mustache index dd195b3..20670a1 100644 --- a/wo/cli/templates/virtualconf.mustache +++ b/wo/cli/templates/virtualconf.mustache @@ -20,15 +20,6 @@ server { location / { return 301 https://{{alias_name}}$request_uri; } - {{/alias}} - {{#proxy}} - add_header X-Proxy-Cache $upstream_cache_status; - location / { - proxy_pass http://{{host}}:{{port}}; - proxy_redirect off; - include proxy_params; - } - {{#alias}} # Security settings for better privacy # Deny hidden files location ~ /\.(?!well-known\/) { @@ -41,6 +32,25 @@ server { auth_basic off; } {{/alias}} + {{#proxy}} + add_header X-Proxy-Cache $upstream_cache_status; + location / { + proxy_pass http://{{host}}:{{port}}; + proxy_redirect off; + include proxy_params; + } + + # Security settings for better privacy + # Deny hidden files + location ~ /\.(?!well-known\/) { + deny all; + } + # letsencrypt validation + location /.well-known/acme-challenge/ { + alias /var/www/html/.well-known/acme-challenge/; + allow all; + auth_basic off; + } {{/proxy}} {{^proxy}}