This commit is contained in:
Dallas Lu 2026-06-05 13:06:08 +08:00
parent cb97070442
commit f04c14116d
No known key found for this signature in database
3 changed files with 19 additions and 3 deletions

View file

@ -0,0 +1,9 @@
set $root_domain "";
if ($server_name ~* ^www\.(?<apex_domain>.+)$) {
set $root_domain $apex_domain;
}
if ($host = $root_domain) {
return 307 $scheme://$server_name$request_uri;
}

View file

@ -0,0 +1,3 @@
if ($host = www.$server_name) {
return 307 $scheme://$server_name$request_uri;
}