nginx中请求头header无法解析下划线

如果一个http请求中包含下划线,比如设置 translate_lang='zh',在nginx中无法解析

解决方法: 1. 请求头header中自定义变量名不要使用下划线

  2. 在nginx.conf中加上underscores_in_headers on配置

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    underscores_in_headers on;
    keepalive_timeout  65;
}

参考引用自:https://www.cnblogs.com/huchong/p/10246031.html

posted @ 2021-05-07 16:20  硬核技术  阅读(922)  评论(0)    收藏  举报