2024-11-29 16:04:56 +08:00

30 lines
1.1 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 8086;
server_name localhost;
keepalive_timeout 60; #连接超时时间默认为75s可以在httpserverlocation块。
client_max_body_size 20M;
client_body_buffer_size 128k;
gzip on;
# 启用gzip压缩的最小文件小于设置值的文件将不会压缩
gzip_min_length 1k;
# 压缩级别1-10数字越大压缩的越好也越占用cpu时间
gzip_comp_level 5;
# 进行压缩的文件类型js有多种形式。其中的值可以在mime.types 文件中找到
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png font/ttf font/otf image/svg+xml;
# 是否在http header中添加vary: Accrpt-Encoeing 建议开启
gzip_vary on;
# 禁用ie6 gzip
gzip_disable "MSIE [1-6]\.";
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}