* http2 error: Invalid HTTP header field was received: frame type: 1, stream: 1, name: [content-length...(err 1)
根据curl的报错信息,可知是Header中content-length有问题:
* http2 error: Invalid HTTP header field was received...: frame type: 1, stream: 1, name: [content-length], value: [0]
将Nginx配置文件中OPTIONS请求的Content-Length配置注释掉..., event-type, event-id, accept, content-type';
# add_header 'Content-Length' 0; // 必须注释,否则HTTP/2会报错...add_header 'Content-Type' 'text/plain, charset=utf-8';
return 200;
}
HTTP/2中对于Header有特殊处理,这应该是导致出错的根本原因