nginx_code
This is an old revision of the document!
Warning: Undefined variable $state in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 130
Warning: Undefined variable $html in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 240
Nginx Code
- force www
- force non www
- forcing HTTPs
The right way is to define a separated server for the naked domain and redirect it.
1 2 3 4 5 6 7 8 9 10 11 |
server { listen 80; server_name example.org; return 301 $scheme: //www .example.org$request_uri; } server { listen 80; server_name www.example.org; ... } |
nginx_code.1428187116.txt.gz · Last modified: 2024/05/23 07:26 (external edit)