In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
The purpose of this article is to share with you what to do when Nginx agents lose information with "_" in the header of header. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Preface
When developing a gateway project, the signature sign_key information is put into the request header header when the request is made, and then taken out from the header when the request is received. It is possible to debug locally, but after being launched, it is found that it cannot be obtained through the Nginx proxy.
Location / {proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; add_header Proxy-Node $upstream_addr; add_header Proxy-Status $upstream_status; proxy_http_version 1.1; proxy_pass http://tianusa;}
Later, it was found that the reason is that Nginx has restrictions on header, and underscores (_) are not supported.
Solution:
1. No need to underline
Change the underscore _ to something else, such as sign_key to sign-key
two。 Lift the restrictions on Nginx from the root
Nginx automatically ignores'_ 'when it contains' _'in the header of the default request.
The solution is to add the following configuration to the http section of the nginx.conf configuration file in nginx:
Underscores_in_headers on; (default underscores_in_headers is off) Thank you for reading! This is the end of the article on "Nginx Agent with header in the head" _ "what if the information is lost". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.