Preface When developing a gateway project, the signature sign_key information is put into the request header when making a request, and then taken out of the header when receiving the request. This works when debugging locally, but after going online, 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 I found out that the reason was that Nginx had some restrictions on headers, and underscores (_) were not supported. Solution: 1. No underscores Change the underscore _ to something else, such as sign_key to sign-key 2. Remove the limitations of Nginx from the root By default, Nginx will automatically ignore any '_' in the request header. 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) Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM. You may also be interested in:
|
<<: Explaining immutable values in React
>>: How to find websites with SQL injection (must read)
Single page application characteristics "Ass...
Table of contents How to represent the current ti...
This article example shares the specific code of ...
First: 4 ways to introduce CSS There are four way...
Cause: NVIDIA graphics card driver is damaged Sol...
Fault site: Log in to the MySQL server and get th...
Code <div class="test"> <div&g...
This article uses an example to describe the crea...
When it comes to bionic design, many people will t...
This article shares the specific code of Vue to i...
The party that creates a new connection is equiva...
Table of contents 1. Cartesian product phenomenon...
[LeetCode] 196.Delete Duplicate Emails Write a SQ...
This article shares the specific code of js to im...
I wrote a simple UDP server and client example be...