http - “accept-ranges”标头设置为“none”而不是“bytes”
问题描述
在向端点发出 curl 请求后,我得到了以下响应
HTTP/2 200
date: Mon, 24 Jun 2019 10:11:39 GMT
content-type: text/html; charset=UTF-8
content-length: 1952
server: nginx
x-powered-by: Express
cache-control: public, max-age=0
last-modified: Tue, 21 May 2019 10:11:37 GMT
vary: Accept-Encoding
x-frame-options: SAMEORIGIN
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-xss-protection: 1; mode=block;
accept-ranges: bytes
最终,我不想要accept-ranges: bytes,而是必须是"accept-ranges: none"
我尝试在 nginx 配置中进行以下操作
server {
.....
.....
.....
location / {
......
......
max_ranges 0;
proxy_force_ranges on;
......
}
}
可能是什么问题?
解决方案
您是否尝试删除“proxy_force_ranges on”?它为来自代理服务器的响应启用字节范围支持,而不管这些响应中的“Accept-Ranges”字段如何。
推荐阅读
- netsuite - 在 NetSuite suitescript 2.0 中运行客户端脚本的问题
- delphi - Delphi - TFDQuery - 如何设置 updateStatus usUnmodified 仅用于一条记录而不还原它?
- networking - 如何使用ip地址查找位置
- flutter - 如何将数据从 StatelessWidget 传递和接收到另一个?
- c# - Xamarin.Forms - DatePicker 复制
- c++ - 如何遍历文本文件中的行并将其与其他行进行比较(C++)
- ruby-on-rails - 尝试在 Rails 上实现搜索功能时获取“表单中的第一个参数不能包含 nil 或为空”
- java - 我不能使用正则表达式替换包含“\”字符的文本
- sql - 左连接不返回任何行
- javascript - 如何在已设置命令处理程序的 discord.js 上使用参数