nginx-kit/redirect/root-to-www.conf
2026-06-05 13:06:08 +08:00

9 lines
184 B
Text

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;
}