From e29c7e11c56ecd846eadcc5b32527a842a4fa316 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 6 Aug 2023 15:47:24 +0200 Subject: [PATCH] improve virtualconf template --- wo/cli/templates/virtualconf.mustache | 28 +++++++++------------------ 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/wo/cli/templates/virtualconf.mustache b/wo/cli/templates/virtualconf.mustache index 19a0336..de65b9d 100644 --- a/wo/cli/templates/virtualconf.mustache +++ b/wo/cli/templates/virtualconf.mustache @@ -20,6 +20,15 @@ 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\/) { @@ -32,25 +41,6 @@ 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}}