gpt4 book ai didi

http - Nginx 服务器内容 gzip 压缩不起作用

转载 作者:可可西里 更新时间:2023-11-01 15:19:45 26 4
gpt4 key购买 nike

这是我的 nginx.conf 中的部分,但我不确定为什么当我检查 gzip 压缩检查器或 http header 时,内容未压缩。

https://pasify.com

user              nginx;
worker_processes 1;

error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;

default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 0;
#keepalive_requests 5;
#keepalive_timeout 65;
send_timeout 10m;

# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;

gzip_buffers 16 8k;

# Disable gzip for certain browsers.
gzip_disable MSIE [1-6].(?!.*SV1);

# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;

## Detect when HTTPS is used
map $scheme $fastcgi_https {
default off;
https on;
}

client_max_body_size 20M;


}

我可以知道这是什么问题吗?

最佳答案

通过

gzip_disable MSIE [1-6].(?!.*SV1);

您已经为几乎所有在其用户代理中包含数字的浏览器禁用了 gzip,因为有两个独立的正则表达式:“MSIE”和“[1-6].(?!.*SV1)”。添加引号或更好地使用它:

gzip_disable msie6;

参见 docs了解详情。

关于http - Nginx 服务器内容 gzip 压缩不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11929977/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com