我遇到了一个我无法解决的服务器问题。 我一直在Chrome浏览器中获取net :: ERR_CONTENT_LENGTH_MISMATCH或css / js脚本。 Nginx不是代理,它只是自己提供文件。 错误不会每次都出现,而且在我刷新页面后,它就会消失。 它出现在计算机与服务器的快速互联网连接(testing多个networking)。 它也出现在Firefox中,但有一个不同的错误信息。 Iv'e试图禁用服务器上的gzip,禁用文件metdatacaching,没有任何工作。 过了一段时间,我发现这个错误只出现在https上,而不是http。 所以我试图改变SSL密码,将SSL证书从Letsencrypt更改为Comodore,没有任何工作。 我已经更新了nginx,仍然是同样的问题。
user nginx; worker_processes 12; error_log /var/log/nginx/error.log crit; pid /var/run/nginx.pid; events { worker_connections 20000; #use epoll; multi_accept on; } http { include /etc/nginx/mime.types; default_type application/octet-stream; #open_file_cache max=200000 inactive=20s; #open_file_cache_valid 30s; #open_file_cache_min_uses 2; #open_file_cache_errors off; open_file_cache off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; error_log /var/log/nginx/error.log error; access_log /var/log/nginx/access.log main; #access_log off; sendfile on; tcp_nopush on; tcp_nodelay on; server_tokens off; keepalive_timeout 60; keepalive_requests 1000; send_timeout 40; reset_timedout_connection on; proxy_buffering on; fastcgi_buffers 512 16k; fastcgi_buffer_size 128k; fastcgi_busy_buffers_size 512k; fastcgi_connect_timeout 20s; fastcgi_send_timeout 120s; fastcgi_read_timeout 120s; fastcgi_temp_file_write_size 512k; server_names_hash_bucket_size 100; client_body_buffer_size 2m; client_max_body_size 2000m; client_header_buffer_size 32k; #large_client_header_buffers 8 8k; gzip off; gzip_comp_level 4; gzip_vary on; gzip_min_length 2000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/xml; #gzip_disable "MSIE [5-6]\."; include /etc/nginx/conf.d/*.conf; }
现在我已经禁用了gzip。
我的相关的vhost文件是:
listen *:80; listen *:443 ssl; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:!MD5:!RC4:!LOW:!MEDIUM:!CAMELLIA:!ECDSA:!DES:!DSS:!3DES:!NULL; ssl_certificate /path/to/cert.crt; ssl_certificate_key /path/to/key.key;
该服务器是一个6核Xeon与HT,64 GB RAM和SSD。 SSD已满50%。 networking负载不是很高。 任何帮助将不胜感激。