Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7470282
  • 博文数量: 368
  • 博客积分: 9600
  • 博客等级: 上校
  • 技术积分: 18875
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-01 00:00
文章分类

全部博文(368)

文章存档

2017年(9)

2016年(19)

2015年(3)

2014年(6)

2013年(8)

2012年(78)

2011年(66)

2010年(135)

2009年(44)

分类: LINUX

2010-07-30 16:38:59

HTTP核心模块支持一些内置变量,变量名与apache里的对应。比如 $http_user_agent,$http_cookie等表示HTTP请求信息的变量。
更多变量:
$args, 请求中的参数;

$content_length, HTTP请求信息里的"Content-Length";

$content_type, 请求信息里的"Content-Type";

$document_root, 针对当前请求的根路径设置值;

$document_uri, 与$uri相同;

$host, 请求信息中的"Host",如果请求中没有Host行,则等于设置的服务器名;

$limit_rate, 对连接速率的限制;

$request_method, 请求的方法,比如"GET"、"POST"等;

$remote_addr, 客户端地址;

$remote_port, 客户端端口号;

$remote_user, 客户端用户名,认证用;

$request_filename, 当前请求的文件路径名

$request_body_file, ??

$request_uri, 请求的URI,带参数;

$query_string, 与$args相同;

$scheme, 所用的协议,比如http或者是https,比如rewrite  ^(.+)$  $scheme://example.com$1  redirect;

$server_protocol, 请求的协议版本,"HTTP/1.0"或"HTTP/1.1";

$server_addr, 服务器地址,如果没有用listen指明服务器地址,使用这个变量将发起一次系统调用以取得地址(造成资源浪费);

$server_name, 请求到达的服务器名;

$server_port, 请求到达的服务器端口号;

$uri, 请求的URI,可能和最初的值有不同,比如经过重定向之类的。

另:参考

阅读(2540) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~