最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Nginx中全局變量整理小結(jié)

 更新時間:2010年08月19日 22:22:15   作者:  
對于Nginx下全局變量整理,方便使用Nginx的朋友調(diào)用全局變量。

Variables

The core module supports built-in variables, whose names correspond with the names of variables in Apache.

First of all, there are the variables, which represent the lines of the title of the client request, for example, $http_user_agent, $http_cookie, and so forth.

Furthermore, there are other variables:
Edit section: $arg_PARAMETER $arg_PARAMETER

This variable contains the value of the GET request variable PARAMETER if present in the query string
Edit section: $args $args

This variable is equal to arguments in the line of request;
Edit section: $binary_remote_addr $binary_remote_addr

The address of the client in binary form;
Edit section: $body_bytes_sent $body_bytes_sent

(undocumented)
Edit section: $content_length $content_length

This variable is equal to line Content-Length in the header of request;
Edit section: $content_type $content_type

This variable is equal to line Content-Type in the header of request;
Edit section: $cookie_COOKIE $cookie_COOKIE

The value of the cookie COOKIE;
Edit section: $document_root $document_root

This variable is equal to the value of directive root for the current request;
Edit section: $document_uri $document_uri

The same as $uri.
Edit section: $host $host

This variable is equal to line Host in the header of request or name of the server processing the request if the Host header is not available.

This variable may have a different value from $http_host when the Host input header is absent or has an empty value.
Edit section: $http_HEADER $http_HEADER

The value of the HTTP header HEADER when converted to lowercase and with ‘dashes' converted to ‘underscores', e.g. $http_user_agent, $http_referer…;
Edit section: $is_args $is_args

Evaluates to “?” if $args is set, “” otherwise.
Edit section: $limit_rate $limit_rate

This variable allows limiting the connection rate.
Edit section: $query_string $query_string

The same as $args.
Edit section: $remote_addr $remote_addr

The address of the client.
Edit section: $remote_port $remote_port

The port of the client;
Edit section: $remote_user $remote_user

This variable is equal to the name of user, authenticated by the Auth Basic Module;
Edit section: $request_filename $request_filename

This variable is equal to path to the file for the current request, formed from directives root or alias and URI request;
Edit section: $request_body $request_body

This variable(0.7.58+) contains the body of the request. The significance of this variable appears in locations with directives proxy_pass or fastcgi_pass.
Edit section: $request_body_file $request_body_file

Client request body temporary filename;
Edit section: $request_completion $request_completion

(undocumented)
Edit section: $request_method $request_method

This variable is equal to the method of request, usually GET or POST.

Before and including 0.8.20, this variable always evaluates to the method name of the main request, not the current request if the current request is a subrequest.
Edit section: $request_uri $request_uri

This variable is equal to the complete initial URI together with the arguments;
Edit section: $scheme $scheme

The HTTP scheme (i.e. http, https). Evaluated only on demand, for example:

rewrite ^(.+)$ $scheme://example.com$1 redirect;

Edit section: $server_addr $server_addr

Equal to the server address. As a rule, for obtaining the value of this variable is done one system call. In order to avoid system call, it is necessary to indicate addresses in directives listen and to use parameter bind.
Edit section: $server_name $server_name

The name of the server.
Edit section: $server_port $server_port

This variable is equal to the port of the server, to which the request arrived;
Edit section: $server_protocol $server_protocol

This variable is equal to the protocol of request, usually this HTTP/1.0 or HTTP/1.1.
Edit section: $uri $uri

This variable is equal to current URI in the request, it can differ from initial, for example by internal redirects, or with the use of index it is file with internal redirects.

參考:

http://www.givingtree.com.cn/entry/Nginx-Location%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95

http://wiki.nginx.org/NginxHttpCoreModule#Variables


$args 此變量與請求行中的參數(shù)相等

$content_length 等于請求行的“Content_Length”的值。

$content_type 等同與請求頭部的”Content_Type”的值

$document_root 等同于當(dāng)前請求的root指令指定的值

$document_uri 與$uri一樣

$host 與請求頭部中“Host”行指定的值或是request到達(dá)的server的名字(沒有Host行)一樣

$limit_rate 允許限制的連接速率

$request_method 等同于request的method,通常是“GET”或“POST”

$remote_addr 客戶端ip

$remote_port 客戶端port

$remote_user 等同于用戶名,由ngx_http_auth_basic_module認(rèn)證

$request_filename 當(dāng)前請求的文件的路徑名,由root或alias和URI request組合而成

$request_body_file

$request_uri 含有參數(shù)的完整的初始URI

$query_string 與$args一樣

$server_protocol 等同于request的協(xié)議,使用“HTTP/1.0”或“HTTP/1.1”

$server_addr request到達(dá)的server的ip,一般獲得此變量的值的目的是進(jìn)行系統(tǒng)調(diào)用。為了避免系統(tǒng)調(diào)用,有必要在listen指令中指明ip,并使用bind參數(shù)。

$server_name 請求到達(dá)的服務(wù)器名

$server_port 請求到達(dá)的服務(wù)器的端口號

$uri 等同于當(dāng)前request中的URI,可不同于初始值,例如內(nèi)部重定向時或使用index

相關(guān)文章

  • win10系統(tǒng)安裝Nginx的詳細(xì)步驟

    win10系統(tǒng)安裝Nginx的詳細(xì)步驟

    Nginx是一款自由的、開源的、高性能的HTTP服務(wù)器和反向代理服務(wù)器,同時也提供了IMAP/POP3/SMTP服務(wù),這篇文章主要介紹了win10系統(tǒng)安裝Nginx的詳細(xì)步驟,需要的朋友可以參考下
    2023-02-02
  • Windows下用Nginx配置https服務(wù)器及反向代理的問題

    Windows下用Nginx配置https服務(wù)器及反向代理的問題

    這篇文章主要介紹了Windows下用Nginx配置https服務(wù)器及反向代理的問題,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-09-09
  • Nginx反向代理之proxy_redirect指令的實(shí)現(xiàn)

    Nginx反向代理之proxy_redirect指令的實(shí)現(xiàn)

    proxy_redirect指令是用來重置頭信息中的"Location"和"Refresh"的值,本文就來詳細(xì)的介紹一下如何使用,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-08-08
  • ubuntu中如何使用nginx監(jiān)聽80端口進(jìn)行轉(zhuǎn)發(fā)

    ubuntu中如何使用nginx監(jiān)聽80端口進(jìn)行轉(zhuǎn)發(fā)

    這篇文章主要介紹了ubuntu中如何使用nginx監(jiān)聽80端口進(jìn)行轉(zhuǎn)發(fā)問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • Nginx跨域設(shè)置Access-Control-Allow-Origin無效的解決辦法

    Nginx跨域設(shè)置Access-Control-Allow-Origin無效的解決辦法

    今天小編就為大家分享一篇關(guān)于Nginx跨域設(shè)置Access-Control-Allow-Origin無效的解決辦法,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2019-02-02
  • WebSocket 配置與Nginx 的完美結(jié)合(過程詳解)

    WebSocket 配置與Nginx 的完美結(jié)合(過程詳解)

    本文詳細(xì)介紹了如何在Nginx中配置WebSocket,確保其在生產(chǎn)環(huán)境中的性能與穩(wěn)定性,從安裝Nginx開始,到基本配置的設(shè)定,再到重啟Nginx應(yīng)用配置,同時,介紹了多種驗(yàn)證WebSocket配置正確性的方法,如使用瀏覽器的開發(fā)者工具、wscat測試工具及編寫客戶端代碼
    2024-11-11
  • 啟動Nginx.exe出現(xiàn)閃退問題的解決方案

    啟動Nginx.exe出現(xiàn)閃退問題的解決方案

    在做項(xiàng)目時,使用老師給的代碼,點(diǎn)擊Nginx.exe出現(xiàn)閃退的情況,出現(xiàn)這個問題可能出現(xiàn)的情況,端口號被占用或者logs下文件路徑有問題,所以本文小編給大家介紹了啟動Nginx.exe出現(xiàn)閃退問題的解決方案,需要的朋友可以參考下
    2024-03-03
  • nginx獲取真實(shí)的ip的方法

    nginx獲取真實(shí)的ip的方法

    在實(shí)際應(yīng)用中,我們可能需要獲取用戶的ip地址,比如做異地登陸的判斷等等,本文主要介紹了nginx獲取真實(shí)的ip的方法,具有一定的參考價值,感興趣的可以了解一下
    2023-08-08
  • 使用Nginx實(shí)現(xiàn)負(fù)載均衡的策略

    使用Nginx實(shí)現(xiàn)負(fù)載均衡的策略

    本篇文章主要介紹了使用Nginx實(shí)現(xiàn)負(fù)載均衡的策略,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-02-02
  • 使用nginx配置訪問wgcloud的方法

    使用nginx配置訪問wgcloud的方法

    這篇文章主要介紹了使用nginx配置訪問wgcloud的方法,在這里大家需要記得agent的配置文件項(xiàng)serverUrl的80端口也要寫上,需要的朋友可以參考下
    2021-06-06

最新評論

正镶白旗| 淮安市| 泰顺县| 绥芬河市| 浦东新区| 康保县| 辽中县| 全椒县| 项城市| 桂林市| 河曲县| 根河市| 阿拉尔市| 合作市| 桃江县| 金塔县| 江达县| 威远县| 华安县| 山西省| 晋宁县| 海安县| 澄江县| 马鞍山市| 澜沧| 东宁县| 广东省| 黄龙县| 西丰县| 沈丘县| 都匀市| 西藏| 泰和县| 永福县| 轮台县| 闻喜县| 凌海市| 西乌| 许昌市| 湖南省| 西青区|