nginx变量(日志log_format)

nginx变量(日志log_format)

  • HTTP请求变量 - arg_PARAMETER、http_HEADER、sent_http_HEADER

它是指http请求中的变量,举例: 

curl访问百度页面,需要在access.log显示Host字段内容

修改/etc/nginx/nginx.conf,配置内容等于http+请求包头名称

访问页面

  • 内置变量 - ngnix内置的

http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format

  • 自定义变量 - 自己定义
原文地址:https://www.cnblogs.com/shhnwangjian/p/7788019.html