今天配置nginx的時候遇到一個問題,直接訪問接口沒有問題,但是通過nginx轉發之后,總是報token失效,無法獲取token值,發現請求頭丟失了。
默認是不支持非nginx標准的用戶自定義header的,如果需要
在http段或者server段加underscores_in_headers on;
http { underscores_in_headers on; server { location / { proxy_pass http://bank/; proxy_set_header app_key ${http_app_key}; } } }