Nginx global Variable 1

Source: Internet
Author: User

Nginx configuration files can be used in the built-in variable starting with the dollar symbol $, also called global variables. Where the values of some of the predefined variables can be changed.

$arg _parameter This variable value is: The value of the variable name PARAMETER parameter in the GET request.

$args this variable equals the parameter in the GET request. For example,foo=123&bar=blahblah; this variable can only be modified

$binary the client address in the form of _remote_addr binary code.

$body the number of bytes transferred to the _bytes_sent page

$content the Content-length field in the _length request header.

$content the Content-type field in the _type request header.

$cookie the value of the _cookie cookie cookie.

$document _root The value specified in the root instruction for the current request.

$document _uri is the same as $uri.

The Host header field in the $host request, or the server name that handles the request (the value of the server_name instruction for the server that handles the request), if the primary header in the request is unavailable or empty. The value is lowercase and does not contain a port.

$hostname machine name using the value of the GetHostName system call

$http the contents of the HTTP request header, the header _header the contents of the HTTP request to lowercase,-to _ (dashes to underscores), for example: $http _user_agent (uaer-agent value), $http _referer ...;

$sent _http_header The contents of the HTTP response header, the header is converted to lowercase in the HTTP response--to _ (dashes to underscores), for example: $sent _http_cache_control, $sent _http_ Content_Type ...;

$is _args If $args is set, the value is "?", otherwise "".

$limit _rate This variable can limit the connection rate.

$nginx _version The Nginx version number that is currently running.

$query _string is the same as $args.

$remote the IP address of the _ADDR client.

$remote the port of the _port client.

$remote _user The user name that has been validated by the Auth Basic module.

$request _filename The file path of the current connection request, generated by the root or alias directive and the URI request.

$request _body this variable (0.7.58+) contains the primary information for the request. It is more meaningful to use location in Proxy_pass or fastcgi_pass directives.

$request the temporary file name of the _body_file client requesting principal information.

$request _completion If the request succeeds, set to "OK", or null if the request is incomplete or not the last part of a series of requests.

$request _method This variable is a client-requested action, usually a get or post.
including 0.8.20 and previous versions, this variable is always the action in main request, and if the current request is a child request, the current requested action is not used.

$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.

The protocol used by the $scheme, such as HTTP or HTTPS, such as rewrite ^ (. +) $ $scheme://example.com$1 redirect;

$server _addr server address, you can determine this value after a system call is complete, and if you want to bypass the system call, you must specify the address in listen and use the bind parameter.

$server the _name server name.

The port number $server the _port request arrives at the server.

The protocol used by the $server _protocol request, usually http/1.0 or http/1.1.

$uri the current URI in the request (without the request parameter, the parameter is in $args) and differs from the value of the $request_uri passed by the browser, it can be modified by internal redirection or by using the index directive. Does not include protocol and hostname, such as/foo/bar.html

Nginx global Variable 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.