内嵌变量
ngx_http_core_module
模块支持内嵌变量,变量名与Apache服务器对应。 首先,这些变量可以表示客户端的请求头字段,诸如$http_user_agent
、$http_cookie
等等。 nginx也支持其他变量:
$arg_
name
name
参数。
$args
$binary_remote_addr
$body_bytes_sent
$bytes_sent
$connection
$content_length
$content_type
$cookie_
name
name
的cookie。
$document_root
$document_uri
$uri
相同。
$host
$hostname
$http_
name
$https
on
”,否则返回空字符串。
$is_args
?
”,否则返回空字符串。
$limit_rate
$msec
$nginx_version
$pid
$query_string
$args
相同。
$realpath_root
$remote_addr
$remote_port
$remote_user
$request
$request_body
在由proxy_pass指令和 fastcgi_pass指令处理的路径中, 这个变量值可用。
$request_body_file
处理完成时,临时文件将被删除。 如果希望总是将请求正文写入文件,需要开启client_body_in_file_only。 如果在被代理的请求或FastCGI请求中传递临时文件名,就应该禁止传递请求正文本身。 使用proxy_pass_request_body off指令 和fastcgi_pass_request_body off指令 分别禁止在代理和FastCGI中传递请求正文。
$request_completion
OK
”,否则返回空字符串。
$request_filename
$request_method
GET
”或者“
POST
”。
$request_time
$request_uri
$scheme
http
”或“
https
”。
$sent_http_
name
$server_addr
为计算这个值,通常需要进行一次系统调用。为了避免系统调用,必须指定listen指令 的地址,并且使用bind
参数。
$server_name
$server_port
$server_protocol
HTTP/1.0
”或“
HTTP/1.1
”。
$status
$tcpinfo_rtt
,
$tcpinfo_rttvar
,
$tcpinfo_snd_cwnd
,
$tcpinfo_rcv_space
TCP_INFO
的系统中可用。
$uri
变量$uri
的值可能随请求的处理过程而改变。 比如,当进行内部跳转时,或者使用默认页文件。