avoid unnecessary ACME challenge redirects

This commit is contained in:
Daniel Micay 2023-02-09 10:12:20 -05:00
parent 763c17a058
commit 76cc4ae336

View File

@ -129,12 +129,18 @@ http {
root /var/empty; root /var/empty;
location /.well-known/acme-challenge/ {
return 301 http://0.grapheneos.org$request_uri;
}
location / {
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
}
server { server {
listen 443 ssl http2; listen 80;
listen [::]:443 ssl http2; listen [::]:80;
server_name 0.grapheneos.org; server_name 0.grapheneos.org;
root /var/empty; root /var/empty;
@ -158,10 +164,6 @@ http {
include snippets/security-headers.conf; include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always; add_header Cross-Origin-Resource-Policy "same-origin" always;
location /.well-known/acme-challenge/ {
return 301 https://0.grapheneos.org$request_uri;
}
location / { location / {
return 301 https://grapheneos.org$request_uri; return 301 https://grapheneos.org$request_uri;
} }
@ -177,10 +179,6 @@ http {
include snippets/security-headers.conf; include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always; add_header Cross-Origin-Resource-Policy "same-origin" always;
location /.well-known/acme-challenge/ {
return 301 https://0.grapheneos.org$request_uri;
}
location / { location / {
return 302 https://github.com/GrapheneOS/Vanadium; return 302 https://github.com/GrapheneOS/Vanadium;
} }
@ -407,10 +405,6 @@ http {
try_files $uri.html =404; try_files $uri.html =404;
} }
location ^~ /.well-known/acme-challenge/ {
return 301 https://0.grapheneos.org$request_uri;
}
location ^~ /fonts/ { location ^~ /fonts/ {
include snippets/security-headers.conf; include snippets/security-headers.conf;
add_header Cross-Origin-Resource-Policy "same-origin" always; add_header Cross-Origin-Resource-Policy "same-origin" always;
@ -510,10 +504,6 @@ http {
location = /.well-known/mta-sts.txt {} location = /.well-known/mta-sts.txt {}
location /.well-known/acme-challenge/ {
return 301 https://0.grapheneos.org$request_uri;
}
location / { location / {
return 404; return 404;
} }