Nginx Read Custom Header
In reference to the information:
Http://stackoverflow.com/questions/8393772/how-to-get-non-standard-http-headers-on-nginx
Http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers
Http://serverfault.com/questions/297225/nginx-passing-back-custom-header
https://easyengine.io/tutorials/nginx/forwarding-visitors-real-ip/
http://www.ttlsa.com/nginx/nginx-proxy_set_header/
After getting the following:
1, Nginx is supported to read non-nginx standard user custom header, but need to open the header under HTTP or server underline support:
2, such as our custom header for X-real-ip, through the second nginx to get the header need this:
3. If you need to pass the custom header to the next nginx:
If is in Nginx custom uses Proxy_set_header x_custom_header $http _host;
If the HEADER is customized at user request, such as curl–head-h "X_custom_header:foo" http://domain.com/api/test, you need proxy_pass_header X_CUSTOM_HEADER
to pass the
Example:
http { {127.0 . 0.1 : 8082 ; } underscores_in_headerson; {Listen ; server_name localhost; location/{Some -Thing $http _x_custom_header;; proxy_set_header X-forwarded- for $proxy _add_x_ Forwarded_for; proxy_pass http://myServer; }}}
The above describes the Nginx get custom header header values, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.