Nginx built-in variable description
1. Internal variable description
Built-in variables are stored in the Ngx_http_core_module module, and the variables are named in the same way as the Apache server variables. In summary, these variables represent the contents of the client request header, such as $http_user_agent, $http _cookie, and so on. Here are all the built-in variables supported by 2.nginx:
Nginx built-in variable $arg_name the parameter name in the request, i.e. "?" The parameter value in the Arg_name=arg_value form of the Arg_name$args request is $binary_remote_addr the binary form of the client address, a fixed length of 4 bytes $body_bytes_ Sent the number of bytes transmitted to the client, and the response header is not counted; This variable remains compatible with the "%B" parameter in Apache's Mod_log_config module $bytes_sent bytes transferred to the client (1.3.8, 1.2.5) $connectionTCP Connected serial number (1.3.8, 1.2.5) $connection _requeststcp Connect the current number of requests (1.3.8, 1.2.5) $content _length "Content-length" Request header field $content_type "Content-type" Request header field $cookie_namecookie name $document_ Root the document root or alias of the current request $document_uri $uri The $host priority is as follows: the hostname of the HTTP request line > Host request header field > matching the requested server name $hostname host name $http_ Name matches any request header field; The second half of the variable name "name" can be replaced with any request header field, such as the need to get the HTTP request header in the configuration file: "Accept-language", then "-" replaced by an underscore, uppercase letters replaced by lowercase, Shape: $http _accept_language can be. $HTTPS If SSL Safe mode is turned on, the value is "on", otherwise it is an empty string. $is _args If there are parameters in the request, the value is "?", otherwise an empty string. $limit _rate is used to set the speed limit for the response, see limit_rate. $msec Current UNIX timestamp (1.3.9, 1.2.6) $nginx _versionnginx version $pid worker process Pid$pipe If the request comes from a pipe communication, the value is "P", otherwise "." (1.3.12, 1.2.7) $proxy _protocol_addr Gets the client address of the proxy access server, which is an empty string if it is accessed directly. (1.5.12) $query _String same as $args $realpath_root The true path of the document root or alias of the current request, all symbolic connections are converted to true paths. $remote _ADDR Client Address $remote_port client Port $remote_user The user name used for the HTTP Basic Authentication Service $request the requested address on behalf of the client $request_ The body client's request principal this variable can be used in the location, passing the request body through proxy_pass, fastcgi_pass, uwsgi_pass, and scgi_ Pass to the next level of proxy server. $request _body_file to save the client request principal in a temporary file. This file needs to be deleted after the file processing is finished. If you need to turn this feature on, you need to set client_body_in_file_only. If the secondary file is passed to the back-end proxy server, you need to disable Request body, which is set Proxy_pass_request_body off,fastcgi_pass_request_body off , uwsgi_pass_request_body off, or scgi_pass_request_body off . $request _completion If the request succeeds, the value is "OK" and is empty if the request is not completed or the request is not the last part of a range request. $request _filename The file path of the current connection request, generated by the root or alias directive and the URI request. $request the length of the _length request (including the requested address, http request header and request body) (1.3.12, 1.2.7) $request the _methodhttp request method, typically " Get "or" POST "$request _time handles the time used by the client request (1.3.9, 1.2.6); the first byte of the read client to start timing. $request _uri This variable equals the original URI that contains some client request parameters, it cannot be modified, see $uri change or rewrite the URI, not including the hostname, for example: "/cnphp/test.php?arg=freemouse". Web protocol, "H $scheme requestTTP " or " https "$sent _http_name can set any HTTP response header field; The second half of the variable name" name "can be replaced with any response header field. If you need to set the response header content-length, replace "-" with an underscore, uppercase letters replaced by lowercase, such as: $sent _http_content_length 4096. $server _ADDR server-side address, it is important to note that in order to avoid access to the Linux system kernel, the IP address should be set in the configuration file in advance. $server the _name server name, the HTTP version of the Www.cnphp.info$server_port server port $server_protocol server, typically "http/1.0" or "http/1.1" $statusHTTP Response codes (1.3.2, 1.2.2) $tcpinfo _rtt, $tcpinfo _rttvar, $tcpinfo _snd_ cwnd, $tcpinfo _rcv_space Client TCP connection specific information $time_iso8601 server time iso 8610 format (1.3.12, 1.2.7) $time _ Local server time (log format format) (1.3.12, 1.2.7) $uri the current URI in the request (without the request parameter, the parameter is in $args), which can be different from the browser passed the $ The value of Request_uri, which can be modified by internal redirection, or by using the index directive, $uri does not contain a hostname, such as "/foo/bar.html". $realpath _root the real directory address instead of the link $proxy_add_x_forwarded_for variable contains the "X-forwarded-for" in the client request header, and the $remote_addr two parts, separated by commas. $proxy _host The variable gets the upstream proxy name for upstream, such as upstream backend $proxy _port the variable represents the port to be proxied to $proxy_protocol_addr$ UPSTREAM_ADDR Agent-to-upstream server address information $upstream_cache_statusAgent-to-upstream server address information $upstream_response_length Upstream server response time $upstream_status the status code of the upstream server response
This article is from the "take a deep Breath again" blog, make sure to keep this source http://ckl893.blog.51cto.com/8827818/1792679
Nginx Real (3) Internal variable description