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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM