This variable is equal to the *original* request URI as received from the client including the args. It cannot be modified. Look at $uri for the post-rewrite/altered URI. Does not include host name. Example: "/foo/bar.php?arg=baz" 
这个变量等于从客户端发送来的原生请求URI,包括参数。它不可以进行修改。$uri变量反映的是重写后/改变的URI。不包括主机名。例如:"/foo/bar.php?arg=baz"
 
This variable is the current request URI, without any arguments (see $args for those). This variable will reflect any modifications done so far by internal redirects or the index module. Note this may be different from $request_uri, as $request_uri is what was originally sent by the browser before any such modifications. Does not include the protocol or host name. Example: /foo/bar.html 
这个变量指当前的请求URI,不包括任何参数(见$args)。这个变量反映任何内部重定向或index模块所做的修改。注意,这和$request_uri不同,因$request_uri是浏览器发起的不做任何修改的原生URI。不包括协议及主机名。例如:"/foo/bar.html"
 
$document_uri
The same as $uri. 
 
nginx内置变量汇总:

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent$http_cookie, and so on. Also there are other variables:

$arg_name
argument name in the request line
$args
arguments in the request line
$binary_remote_addr
client address in a binary form, value’s length is always 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses
$body_bytes_sent
number of bytes sent to a client, not counting the response header; this variable is compatible with the “%B” parameter of the mod_log_config Apache module
$bytes_sent
number of bytes sent to a client (1.3.8, 1.2.5)
$connection
connection serial number (1.3.8, 1.2.5)
$connection_requests
current number of requests made through a connection (1.3.8, 1.2.5)
$content_length
“Content-Length” request header field
$content_type
“Content-Type” request header field
$cookie_name
the name cookie
$document_root
root or alias directive’s value for the current request
$document_uri
same as $uri
$host
in this order of precedence: host name from the request line, or host name from the “Host” request header field, or the server name matching a request
$hostname
host name
$http_name
arbitrary request header field; the last part of a variable name is the field name converted to lower case with dashes replaced by underscores
$https
on” if connection operates in SSL mode, or an empty string otherwise
$is_args
?” if a request line has arguments, or an empty string otherwise
$limit_rate
setting this variable enables response rate limiting; see limit_rate
$msec
current time in seconds with the milliseconds resolution (1.3.9, 1.2.6)
$nginx_version
nginx version
$pid
PID of the worker process
$pipe
p” if request was pipelined, “.” otherwise (1.3.12, 1.2.7)
$proxy_protocol_addr
client address from the PROXY protocol header, or an empty string otherwise (1.5.12)

The PROXY protocol must be previously enabled by setting the proxy_protocol parameter in the listen directive.

$proxy_protocol_port
client port from the PROXY protocol header, or an empty string otherwise (1.11.0)

The PROXY protocol must be previously enabled by setting the proxy_protocol parameter in the listen directive.

$query_string
same as $args
$realpath_root
an absolute pathname corresponding to the root or alias directive’s value for the current request, with all symbolic links resolved to real paths
$remote_addr
client address
$remote_port
client port
$remote_user
user name supplied with the Basic authentication
$request
full original request line
$request_body
request body

The variable’s value is made available in locations processed by the proxy_passfastcgi_pass,uwsgi_pass, and scgi_pass directives when the request body was read to a memory buffer.

$request_body_file
name of a temporary file with the request body

At the end of processing, the file needs to be removed. To always write the request body to a file,client_body_in_file_only needs to be enabled. When the name of a temporary file is passed in a proxied request or in a request to a FastCGI/uwsgi/SCGI server, passing the request body should be disabled by the proxy_pass_request_body offfastcgi_pass_request_body off,uwsgi_pass_request_body off, or scgi_pass_request_body off directives, respectively.

$request_completion
OK” if a request has completed, or an empty string otherwise
$request_filename
file path for the current request, based on the root or alias directives, and the request URI
$request_id
unique request identifier generated from 16 random bytes, in hexadecimal (1.11.0)
$request_length
request length (including request line, header, and request body) (1.3.12, 1.2.7)
$request_method
request method, usually “GET” or “POST
$request_time
request processing time in seconds with a milliseconds resolution (1.3.9, 1.2.6); time elapsed since the first bytes were read from the client
$request_uri
full original request URI (with arguments)
$scheme
request scheme, “http” or “https
$sent_http_name
arbitrary response header field; the last part of a variable name is the field name converted to lower case with dashes replaced by underscores
$sent_trailer_name
arbitrary field sent at the end of the response (1.13.2); the last part of a variable name is the field name converted to lower case with dashes replaced by underscores
$server_addr
an address of the server which accepted a request

Computing a value of this variable usually requires one system call. To avoid a system call, the listendirectives must specify addresses and use the bind parameter.

$server_name
name of the server which accepted a request
$server_port
port of the server which accepted a request
$server_protocol
request protocol, usually “HTTP/1.0”, “HTTP/1.1”, or “HTTP/2.0
$status
response status (1.3.2, 1.2.2)
$tcpinfo_rtt$tcpinfo_rttvar$tcpinfo_snd_cwnd$tcpinfo_rcv_space
information about the client TCP connection; available on systems that support the TCP_INFO socket option
$time_iso8601
local time in the ISO 8601 standard format (1.3.12, 1.2.7)
$time_local
local time in the Common Log Format (1.3.12, 1.2.7)
$uri
current URI in request, normalized

The value of $uri may change during request processing, e.g. when doing internal redirects, or when using index files.

 
 

nginx uri和request_uri区别的更多相关文章

  1. nginx 的uri、request_uri 区别

    在nginx中有几个关于uri的变量,包括$uri $request_uri $document_uri,下面看一下他们的区别 : $request_uri: /stat.php?id=1585378 ...

  2. nginx中,$request_uri和$uri的区别

    nginx中,$request_uri和$uri的区别   $request_uri This variable is equal to the *original* request URI as r ...

  3. 详解 $_SERVER 函数中QUERY_STRING和REQUEST_URI区别

    详解 $_SERVER 函数中QUERY_STRING和REQUEST_URI区别 http://blog.sina.com.cn/s/blog_686999de0100jgda.html   实例: ...

  4. apache与nginx日志文件的区别(转载)

    apache与nginx日志文件的区别 转载:http://www.xfcodes.com/apache/log/3270.htm 导读:apache与nginx日志文件的区别,在apache与ngi ...

  5. 简析 Tomcat 、Nginx 与 Apache 的区别

    简析 Tomcat .Nginx 与 Apache 的区别 本文讲的是简析 Tomcat .Nginx 与Apache的区别, 经常在用 apache 和 tomcat 等这些服务器,可是总感觉还是不 ...

  6. nginx和uwsgi的区别和作用

    Django+uwsgi+nginx nginx和uwsgi的区别和作用: 1, nginx是对外的服务器,外部浏览器通过url访问nginx, uwsgi是对内的服务器,主要用来处理动态请求. 2, ...

  7. nginx 和uwsgi的区别与作用

    在介绍nginx和uwsgi的区别和作用之前我们先介绍一下几个概念 1.WSGI WSGI的全称是Web Server Gateway Interface(Web服务器网关接口),它不是服务器.pyt ...

  8. nginx参数 uri和request_uri讨论

    uri可以输出rewrite后的uri不带参数,要用args查看 request_uri 是请求的完整的uri带参数

  9. 详细解析 nginx uri 如何匹配 location 规则

    location 是 nginx 配置中出现最频繁的配置项,一个 uri 是如何与多个 location 进行匹配的? 在有多个 location 都匹配的情况下,如何决定使用哪一个 location ...

随机推荐

  1. HDU 1754.I Hate It-完全版线段树(单点替换、区间最值)

    HDU1754.I Hate It 直接模板就可以了 代码: //B #include<iostream> #include<cstdio> #include<cstri ...

  2. NOIP2018提高组模拟题(二)

    咒语(curse) Description 亮亮梦到自己来到了魔法城堡,但一扇巨大的石门阻拦了他通向城堡内的路. 正当他沮丧之际,突然发现门上有一处机关,机关上有一张很长的纸条. 亮亮拿起纸条的一端, ...

  3. JQuery里面的下啦菜单

    <!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8" ...

  4. 1.NFC入门

    1.什么是NFC? 近距离无线通信技术(Near Field Communication,NFC).NFC提供了一种简单的.非触控式的解决方案,可以让消费者简单直观地交换信息.访问内容与服务. 2.运 ...

  5. 《Flex 第一步》

    //什么是FlexFlex 是一个针对企业级富互联网应用的表示层解决方案.具体地说,Flex是一种应用程序框架.富互联网应用程序,Rich Internet Application,简称RIA,将桌面 ...

  6. Winform打砖块游戏制作step by step第二节---.画挡板

    一 引子 为了让更多的编程初学者,轻松愉快地掌握面向对象的思考方法,对象继承和多态的妙用,故推出此系列随笔,还望大家多多支持. 预备知识,无GDI画图基础的童鞋请先阅读一篇文章让你彻底弄懂WinFor ...

  7. 打包工具 使用帮助 inno setup

    http://wenku.baidu.com/link?url=0VRJ8n9am1KgVAAqwz-AU1htXamo7Vh0d4QIdGG6_LcTrZBdb7lRim8Jx6M8KaLJDQm1 ...

  8. linux命令详解:df命令

    转:http://www.cnblogs.com/lwgdream/p/3413579.html 前言 df命令用来查看系统的space和inode使用情况,也是常用命令之一 使用说明 -a 显示所有 ...

  9. Using xcodebuild To Export a .ipa From an Archive

    Xcode 6 changes how you export a .ipa from an archive for adhoc distribution. It used to be that you ...

  10. hdu1021(C++)

    打表找规律,发现是n%4==2就是yes,否则是no #include<iostream>using namespace std;int main(){ int n; while (cin ...