@
HLT 完整配置
server {
listen 80;
server_name
example.com www.example.com;
return 301
https://example.com$request_uri;
}
server {
listen 443 ssl http2;
ssl on;
ssl_certificate /usr/local/nginx/conf/example.crt;
ssl_certificate_key /usr/local/nginx/conf/example.key;
server_name
www.example.com;
return 301
https://example.com$request_uri;
}
server
{
#listen 80;
listen 443 ssl http2;
#listen [::]:80;
ssl on;
ssl_certificate /usr/local/nginx/conf/example.crt;
ssl_certificate_key /usr/local/nginx/conf/example.key;
server_name
example.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/
example.com;
include example.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log off;
}