html - net::ERR_HTTP2_PROTOCOL_ERROR 200 渲染大型 html 文件时
问题描述
我在 nginx 和 Cloudflare 后面有一个 golang 应用程序,它提供大型 html 文件,但我注意到对于 GET 请求,在大约 900KB 大小之后,html 被截断并且页面的按钮不显示。
Firefox 和 Chrome 都存在这个问题。在 Chrome 控制台中,我得到:
net::ERR_HTTP2_PROTOCOL_ERROR 200
这是我的 nginx.conf 相关部分
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_body_timeout 12;
client_header_timeout 12;
keepalive_timeout 15;
send_timeout 10;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 32 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
我增加gzip_buffers
了16 4k
to32 8k
甚至禁用了 gzip 压缩,但这些并没有解决问题。
感谢您解决此问题的提示。
解决方案
推荐阅读
- java - MapView 地图未在运行时呈现 {Screenshot Attached}
- python - Python Selenium WebDriverException:消息:chrome 不可访问,当两者都是最新的
- ios - SF Symbol imageView 不符合pointSize?
- python - 当提供的数据是 XML 时,如何从检查菜单中检索相同的 HTML?
- c# - 为实现分组的 UWP XAML 创建自定义 ICollectionView 对象
- python - 在长字符串python中插入字符
- python - 如何为自定义日历和时间表重新采样和清理数据框?
- javascript - 按 id mongoose 分组字段
- python - 微秒必须在 0..999999(获取 Outlook 电子邮件时间)
- python - 使用 bonobo_sqlalchemy (ETL) 在 Bonobo 中进行跨数据库连接