nginx之常用内置变量,命令及配置

一,nginx常用内置变量

$binary_remote_addr   远程地址的二进制表示
$scheme              所用的协议,比如http或者是https
$content_length       http请求信息里的"Content-Length";
$content_type        请求信息里的"Content-Type";
$request_method      请求的方法,比如"GET"、"POST"等; 
$remote_addr         客户端IP地址; 
$http_host          客户端主机
$http_user_agent     客户端agent信息;
$http_cookie         客户端cookie信息;
$request_uri         包含请求参数的原始URI,不包含主机名,如:"/foo/bar.php?arg=baz";
$time_local          获取当前时间,格式:19/Jun/2016:12:52:35 +0800

 

二,nginx常用内置命令

#设置请求头proxy_set_header
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  

 

三,nginx常用配置

   参考连接: http://www.9958.pw/post/nginx_config

猜你喜欢

转载自pandan-xyz.iteye.com/blog/2305966