30 lines
1.1 KiB
Nginx Configuration File
30 lines
1.1 KiB
Nginx Configuration File
server {
|
||
listen 8086;
|
||
server_name localhost;
|
||
keepalive_timeout 60; #连接超时时间,默认为75s,可以在http,server,location块。
|
||
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;
|
||
}
|
||
|
||
} |