Ngx_http_core_module模块支持内置变量,他们的名字和apache的内置变量是一致的。
首先是说明客户请求title中的行,例如 h t t p u s e r a g e n t , http_user_agent, httpuseragent,http_cookie等等。
此外还有其它的一些变量
$args此变量与请求行中的参数相等
$content_length等于请求行的“Content_Length”的值。
$content_type等同与请求头部的”Content_Type”的值
$document_root等同于当前请求的root指令指定的值
d o c u m e n t u r i 与 document_uri与 documenturi与uri一样 请求当中的uri
$host与请求头部中“Host”行指定的值或是request到达的server的名字(没有Host行)一样
$limit_rate允许限制的连接速率
$request_method等同于request的method,通常是“GET”或“POST”
$remote_addr客户端ip
$remote_port客户端port
$remote_user等同于用户名,由ngx_http_auth_basic_module认证
$request_filename当前请求的文件的路径名,由root或alias和URI request组合而成
$request_body_file
$request_uri含有参数的完整的初始URI
q u e r y s t r i n g 与 query_string与 querystring与args一样
$sheeme http模式(http,https)尽在要求是评估例如
Rewrite ^(.+)$ s h e m e : / / e x a m p l e . c o m sheme://example.com sheme://example.com; Redirect;
$server_protocol等同于request的协议,使用“HTTP/或“HTTP/
$server_addr request到达的server的ip,一般获得此变量的值的目的是进行系统调用。为了避免系统调用,有必要在listen指令中指明ip,并使用bind参数。
$server_name请求到达的服务器名
$server_port请求到达的服务器的端口号
$uri等同于当前request中的URI,可不同于初始值,例如内部重定向时或使用index
转载地址:https://blog.csdn.net/tjcyjd/article/details/50695922