update
This commit is contained in:
parent
c50569d73e
commit
a624163120
27 changed files with 215 additions and 6 deletions
|
|
@ -1,9 +1,14 @@
|
|||
set $root_domain "";
|
||||
|
||||
# Derive the apex domain from a www-prefixed primary server_name. This keeps the
|
||||
# snippet simple, but it also means callers should not use it on multi-name
|
||||
# server blocks whose first name is not the canonical www host.
|
||||
if ($server_name ~* ^www\.(?<apex_domain>.+)$) {
|
||||
set $root_domain $apex_domain;
|
||||
}
|
||||
|
||||
# Use 307 so POST and other non-GET methods keep their method during
|
||||
# canonicalization instead of being rewritten to GET as with many 301/302 flows.
|
||||
if ($host = $root_domain) {
|
||||
return 307 $scheme://$server_name$request_uri;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue