nginx_code
This is an old revision of the document!
Nginx Code
- force www
- force non www
- forcing_https - Page not found.
The right way is to define a separated server for the naked domain and redirect it.
server {
listen 80;
server_name example.org;
return 301 $scheme://www.example.org$request_uri;
}
server {
listen 80;
server_name www.example.org;
...
}
Note that this also works with HTTPS site.
nginx_code.1428187042.txt.gz · Last modified: (external edit)
