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)
You can go to the Ubuntu official website to down...
VMware version: VMware-workstation-full-16 VMware...
Table of contents Problem Description Solution Pr...
I recently used Dreamweaver to make a product pres...
I have been depressed for a long time, why? Some t...
Table of contents Vite project build optimization...
Most of this article refers to other tutorials on...
1. Introduction to fastdfs 1. What is fastdfs Fas...
1. Upgrade process: sudo apt-get update Problems ...
Table of contents 1. Introduction 2. Why do we ne...
This article has compiled some so-called specific...
If you often use FTP server in your study or work...
When the height attribute of Text is defined, the ...
background As the company's sub-projects incr...