Nginx built-in variables

Source: Internet
Author: User
Nginx built-in variable list, which extracts Nginx built-in variables according to nginx source code file ngx_http_variables.c. According to different versions, the variables may change, and most of them can still be used. Name version description (the variable list comes from the ngx_http_variab file... nginx built-in variable list. Nginx built-in variables are extracted according to nginx source code file ngx_http_variables.c.
According to different versions, the variables may change, and most of them can still be used.




Name Version Description (the variable list is from the ngx_http_variables file)
$ Args 1.0.8 Parameters in the request;
$ Binary_remote_addr 1.0.8 Binary representation of remote addresses
$ Body_bytes_sent 1.0.8 Number of sent message body bytes
$ Content_length 1.0.8 "Content-Length" in the HTTP request information ";
$ Content_type 1.0.8 "Content-Type" in the request information ";
$ Document_root 1.0.8 Set the value for the root path of the current request;
$ Document_uri 1.0.8 Same as $ uri;
$ Host 1.0.8 "Host" in the request information. if the request does not contain the Host line, it is equal to the configured server name;
$ Hostname 1.0.8  
$ Http_cookie 1.0.8 Cookie information
$ Http_post 1.0.8  
$ Http_referer 1.0.8 Reference address
$ Http_user_agent 1.0.8 Client proxy information
$ Http_via 1.0.8 The IP address of the last access server. Http://www.cnblogs.com/deng02/archive/2009/02/11/1387911.html
$ Http_x_forwarded_for 1.0.8 It is equivalent to the network access path. Http://www.cnblogs.com/craig/archive/2008/11/18/1335809.html
$ Is_args 1.0.8  
$ Limit_rate 1.0.8 Restrictions on connection speed;
$ Nginx_version 1.0.8  
$ Pid 1.0.8  
$ Query_string 1.0.8 Same as $ args;
$ Realpath_root 1.0.8  
$ Remote_addr 1.0.8 Client address;
$ Remote_port 1.0.8 Client port number;
$ Remote_user 1.0.8 Client user name, used for authentication;
$ Request 1.0.8 User request
$ Request_body 1.0.8  
$ Request_body_file 1.0.8 Name of the local file sent to the backend
$ Request_completion 1.0.8  
$ Request_filename 1.0.8 File path name of the current request
$ Request_method 1.0.8 Request methods, such as "GET" and "POST;
$ Request_uri 1.0.8 The requested URI with parameters;
$ Scheme 1.0.8 The protocol used, such as http or https, such as rewrite ^ (. +) $ scheme: // example.com $1 redirect;
$ Sent_http_cache_control 1.0.8  
$ Sent_http_connection 1.0.8  
$ Sent_http_content_length 1.0.8  
$ Sent_http_content_type 1.0.8  
$ Sent_http_keep_alive 1.0.8  
$ Sent_http_last_modified 1.0.8  
$ Sent_http_location 1.0.8  
$ Sent_http_transfer_encoding 1.0.8  
$ Server_addr 1.0.8 Server address. if you do not use listen to specify the server address, using this variable will initiate a system call to obtain the address (resulting in a waste of resources );
$ Server_name 1.0.8 The name of the server to which the request arrives;
$ Server_port 1.0.8 The port number of the server to which the request arrives;
$ Server_protocol 1.0.8 Request Protocol version, "HTTP/1.0" or "HTTP/1.1 ";
$ Uri 1.0.8 The requested URI may be different from the original value, for example, after redirection

Related Article

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.