33 lines
819 B
Plaintext
33 lines
819 B
Plaintext
server {
|
|
listen 80;
|
|
server_name www.syoai.cn;
|
|
|
|
root "D:/phpstudy_pro/WWW/h5/official-site-syoai";
|
|
index index.html index.htm;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 静态资源缓存
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
|
|
# 禁止访问隐藏文件
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
|
|
# gzip 压缩
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
|
gzip_vary on;
|
|
|
|
access_log logs/www.syoai.cn.access.log;
|
|
error_log logs/www.syoai.cn.error.log;
|
|
}
|