soybean-admin/docker/nginx.conf
2024-03-30 23:11:22 +08:00

51 lines
1.7 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 80;
server_name localhost;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_connect_timeout 5;
proxy_send_timeout 1800;
proxy_read_timeout 1800;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
auth_basic "status";
#开启gzip
gzip on;
#低于1kb的资源不压缩
gzip_min_length 1k;
#压缩级别1-9越大压缩率越高同时消耗cpu资源也越多建议设置在5左右。
gzip_comp_level 5;
#需要压缩哪些响应类型的资源,多个空格隔开。不建议压缩图片.
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
#配置禁用gzip条件支持正则。此处表示ie6及以下不启用gzip因为ie低版本不支持
gzip_disable "MSIE [1-6]\.";
#是否添加“Vary: Accept-Encoding”响应头
gzip_vary on;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html; #VUE项目配置路由必须
}
location ^~ /assessh5 {
alias /usr/share/nginx/html; # inflow uni-app H5编译文件的目录,index.html所在目录
try_files $uri $uri/ /index.html last;
index index.html index.htm;
}
# location /inflow {
# try_files $uri $uri/ /inflow/index.html;
# root /usr/share/nginx/html/inflow/;
# index index.html;
# }
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}