24 lines
555 B
Nginx Configuration File
24 lines
555 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# 开启压缩
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
|
|
# 静态资源缓存
|
|
location ~* \.(css|js|svg|png|jpg|jpeg|gif|ico|woff2?)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
# 支持 /guide、/report、/support 无后缀访问
|
|
location / {
|
|
try_files $uri $uri.html $uri/ /index.html;
|
|
}
|
|
}
|