问题原文
原帖链接 · Dani · CC BY-SA 4.0
Moving a request to my internal nginx server I add to the call:
proxy_set_header X-Real-IP $remote_addr;
when I try to print this value in the log the internal nginx the container crashes:
log_format verbose ' Real: $X-Real-IP ';
What am I doing wrong? (I also tried with "" around the variable, it didn't help.)
已采纳解答
原帖链接 · Richard Smith · CC BY-SA 4.0
The server receives X-Real-IP as one of the headers in the HTTP request. Nginx makes each of the request header values available as a variable.
The variable name for http request header values begins with $http_. The header name is converted to lowercase, and each hyphen is replaced with an underscore.
For example X-Real-IP is available as $http_x_real_ip
See this document for details.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
