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