Nginx常用的内置全局变量

名称        备注
$args     //请求中的参数;
$binary_remote_addr     //远程地址的二进制表示
$body_bytes_sent     //已发送的消息体字节数
$content_length     //HTTP请求信息里的"Content-Length";
$content_type     //请求信息里的"Content-Type";
$document_root     //针对当前请求的根路径设置值;
$document_uri     //与$uri相同;
$host     //请求信息中的"Host",如果请求中没有Host行,则等于设置的服务器名;
$http_cookie     //cookie
$http_referer     //引用地址
$http_header     //$http_referer...;
$http_user_agent     //客户端代理信息
$http_via     //最后一个访问服务器的Ip地址。https://blog.csdn.net/knight_zhou/article/details/103778140
$http_x_forwarded_for     //相当于网络访问路径。https://blog.csdn.net/knight_zhou/article/details/103778140
$limit_rate     //对连接速率的限制;
$query_string     //与$args相同;
$remote_addr     //客户端地址;
$remote_port     //客户端端口号;
$remote_user     //客户端用户名,认证用;
$request     //用户请求
$request_body_file     //发往后端的本地文件名称
$request_filename     //当前请求的文件路径名,比如$request_filename:D:\nginx/html/test1/test2/test.php
$request_method     //请求的方法,比如"GET"、"POST"等;
$request_uri     //请求的URI,带参数;
$scheme     //所用的协议,比如http或者是https,比如rewrite^(.+)$$scheme://example.com$1redirect;
$server_addr     //服务器地址,如果没有用listen指明服务器地址,使用这个变量将发起一次系统调用以取得地址(造成资源浪费);
$server_name     //请求到达的服务器名;
$server_port     //请求到达的服务器端口号;
$server_protocol     //请求的协议版本,"HTTP/1.0"或"HTTP/1.1";
$uri     //请求的URI,可能和最初的值有不同,比如经过重定向之类的。

发布了56 篇原创文章 · 获赞 29 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/knight_zhou/article/details/103967576