From 5de8bc663cac7cd4eef9aa2e4bb626e607a4abd1 Mon Sep 17 00:00:00 2001 From: Jacob Michalskie Date: Nov 03 2022 22:26:10 +0000 Subject: Prevent duplicate locations --- diff --git a/pillar/role/web_static.sls b/pillar/role/web_static.sls index 62bd92b..d9c1f8d 100644 --- a/pillar/role/web_static.sls +++ b/pillar/role/web_static.sls @@ -40,10 +40,15 @@ nginx: - return: 404 - location ~ /\.git: - return: 404 + {% if website == 'community' %} + - location /: + - return: 301 https://www.opensuse.org/ + {% else %} - location /: - index: - index.html - index.htm + {% endif %} - location ~* \.(?:ttf|otf|eot|woff)$: - add_header: Access-Control-Allow-Origin "*" {% if website == 'static' %} @@ -56,10 +61,6 @@ nginx: - location ~ "^/\.well-known/": - add_header: Access-Control-Allow-Origin "*" {% endif %} - {% if website == 'community' %} - - location /: - - return: 301 https://www.opensuse.org/ - {% endif %} - error_page: 405 = $uri - error_page: 405 =200 $uri - error_page: 500 502 503 504 /50x.html