Nginx built-in predefined variables

Source: Internet
Author: User
The built-in variables that can be used in the nginx configuration file start with the dollar sign $, or global variables. The values of some predefined variables can be changed. $ Arg_PARAMETER the variable value is the value of the variable name PARAMETER in the GET request. $ Args this variable is equivalent to the built-in variables that can be used in the configuration file of GET... nginx starting with the dollar sign $, or global variables. The values of some predefined variables can be changed. $ Arg_PARAMETER the variable value is the value of the variable name PARAMETER in the GET request. $ Args: the variable is equal to the parameter in the GET request. For example, foo = 123 & bar = blahblah; this variable can only be modified to the client address in the format of $ binary_remote_addr binary code. $ Body_bytes_sent number of bytes on the transfer page $ Content-length field in the content_length request header. The Content-Type field in the $ content_type request header. $ Cookie_COOKIE cookie value. $ Document_root the value specified by the current request in the root command. $ Document_uri is the same as $ uri. $ Host header field in the Host request. if the host header in the request is unavailable or empty, it is the name of the server that processes the request (the value of the server_name command of the server that processes the request ). The value is in lowercase and does not contain ports. $ Hostname: The value called by the gethostname system for the machine name $ http_HEADER content in the HTTP request HEADER. the HEADER is converted to lowercase and-to _ (the dash is changed to underline). For example: $ http_user_agent (Uaer-Agent value), $ http_referer ...; $ sent_http_HEADER: the content in the HTTP response HEADER. the HEADER is converted to lowercase and-to _ (the break number is changed to underline). For example: $ sent_http_cache_control, $ sent_http_content_type ...; $ is_args if $ args is set, the value is "? ", Otherwise it is "". The $ limit_rate variable can limit the connection rate. $ Nginx_version: The nginx version currently running. $ Query_string is the same as $ args. $ Remote_addr client IP address. $ Remote_port: the port of the client. $ Remote_user: The username verified by the Auth Basic Module. $ Request_filename the file path of the current connection request, which is generated by the root or alias command and URI request. The $ request_body variable (0.7.58 +) contains the main information of the request. It makes sense in the location where the proxy_pass or fastcgi_pass command is used. $ Request_body_file temporary file name of the client request subject information. $ Request_completion: if the request is successful, set it to "OK". if the request is incomplete or is not the last part of a series of requests, set it to null. $ Request_method the variable is the action requested by the client, usually GET or POST. In versions 0.8.20 and earlier, this variable is always an action in main request. if the current request is a subrequest, this action is not used. $ Request_uri: the variable is the original URI that contains some client request parameters. it cannot be modified. Please check $ uri to change or override the URI. $ The protocol used by scheme, such as http or https, such as rewrite ^ (. +) $ scheme: // example.com $1 redirect; $ server_addr server address, which can be determined after a system call is completed. if you want to bypass the system call, you must specify the address in listen and use the bind parameter. $ Server_name server name. $ Server_port indicates the port number of the request to reach the server. $ Server_protocol the protocol used by the request, usually HTTP/1.0 or HTTP/1.1. $ The current uri in the URI request (without the request parameter, the parameter is located in $ args). Unlike the $ request_uri value passed by the browser, it can be internally redirected, or use the index command to modify the data. The protocol and host name are not included, such as/foo/bar.html.

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.