Answers for "redirect www to non-www nginx"

0

nginx redirect www to non-www

server {
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
}
Posted by: Guest on October-20-2020
0

nginx redirect to non www

server {
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
}
Posted by: Guest on June-08-2020
1

redirect www to non-www nginx

# With wildcard:

server {
    server_name ~^(www\.)(?<domain>.+)$;
    return 301 $scheme://$domain;
}
Posted by: Guest on April-02-2021

Code answers related to "redirect www to non-www nginx"

Browse Popular Code Answers by Language