<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    iamhuzl

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      1 隨筆 :: 13 文章 :: 21 評論 :: 0 Trackbacks
        由于80端口需要root用戶才能使用,所以tomcat都是root用戶管理的,為了安全起見昨天安裝了一個nginx作為反向代理,tomcat改為8080端口。但測試發現有幾個接口一直報錯,幾個HTTP頭取不到值,比對其他請求發現是包含了下劃線。在百度和stackoverflow上查找問題發現,要求配置一下nginx,支持HTTP Header name支持下劃線:
    Syntax:underscores_in_headers on | off;
    Default:
    underscores_in_headers off;
    Context:httpserver

    Enables or disables the use of underscores in client request header fields. When the use of underscores is disabled, request header fields whose names contain underscores are marked as invalid and become subject to the ignore_invalid_headers directive.

    If the directive is specified on the server level, its value is only used if a server is a default one. The value specified also applies to all virtual servers listening on the same address and port.

    但是nginx為什么要加這個配置呢,查找資料有的說HTTP Header name不能包含下劃線。
    翻了翻HTTP RFC,好像沒有這個要求。

    3.2 Header Fields


    Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

      header-field   = field-name ":" OWS field-value OWS    
    field-name = token

    token
    的范思科表達式定義:
    token = 1*tchar
    tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA ; any VCHAR, except delimiters
    Delimiters are chosen from the set of US-ASCII visual characters not allowed in a token (DQUOTE and "(),/:;<=>?@[\]{}").

    如果沒理解錯的話,HTTP header name應該可以包含下劃線的。
    還是下劃線在nginx里有特殊用途,好像有的說是cgi會用到。
    posted on 2014-07-10 12:37 溫水青蛙 閱讀(2050) 評論(1)  編輯  收藏

    評論

    # re: nginx處理HTTP header問題 2016-05-27 19:53 sAka
    感謝您的經驗,萬分感謝。  回復  更多評論
      


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 久久av免费天堂小草播放| 51午夜精品免费视频| 亚洲av永久无码嘿嘿嘿| 亚洲精品美女久久久久| 亚洲人片在线观看天堂无码| 国产偷国产偷亚洲清高APP| 一区二区三区在线免费观看视频| 久久成人无码国产免费播放| 久久国内免费视频| 免费人成在线观看播放国产| 亚洲精品人成在线观看| 亚洲一卡2卡三卡4卡无卡下载 | A级毛片内射免费视频| 亚洲精品综合久久| 亚洲理论在线观看| 在线视频免费观看高清| 亚洲国产精品无码久久一区二区 | 美女啪啪网站又黄又免费| 久久免费的精品国产V∧| 国产a级特黄的片子视频免费| 亚洲AV日韩精品久久久久久| 色噜噜狠狠色综合免费视频 | 国产成人无码区免费内射一片色欲| 1000部拍拍拍18勿入免费视频软件| 亚洲精品国产精品乱码不卡 | 无码一区二区三区免费| 久久亚洲AV无码西西人体| 亚洲AV无码专区在线亚| 全免费A级毛片免费看网站| 亚洲久本草在线中文字幕| 成人免费午夜无码视频| 另类小说亚洲色图| 宅男666在线永久免费观看| 亚洲最大的成人网| 亚洲国产成人精品久久久国产成人一区二区三区综 | 国产精品亚洲а∨天堂2021| 国产AV无码专区亚洲AWWW| 特级毛片A级毛片免费播放| 相泽亚洲一区中文字幕| 国产成人精品免费视频网页大全| 337p日本欧洲亚洲大胆人人|