<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## root與alias區別 ``` location ^~ /admin { alias /var/www/admin/; index regist.html; } location / { root /data/html/; index index.html index.html; } ``` - root的處理結果是:root路徑+location路徑 - alias的處理結果是:使用alias路徑替換location路徑 - alias是一個目錄別名的定義,root則是最上層目錄的定義 - 重要的區別是alias后面必須要用“/”結束,而root不強制 ### root與alias 后跟 "/" 的區別 ``` location ^~ /dev-popularize/ { # 必須有 dev-popularize 這個目錄,靜態資源文件都在這個目錄下 root /Users/wxq/Desktop/shounaer/dist; # 不需要有 dev-popularize 這個目錄,靜態資源文件直接放在dist目錄下 root /Users/wxq/Desktop/shounaer/dist/; # 則 dist 目錄下,無論有沒有dev-popularize 都不行,會報 403 alias /Users/wxq/Desktop/shounaer/dist; # 則 dist 目錄下,直接放你的靜態資源文件就行 # alias /Users/wxq/Desktop/shounaer/dist/; index regist.html; } ``` ## location 開頭 語法規則: `location \[ = | ~ | ~ \* | ^~ \] /uri/ { … }` ### 以 = 開頭,表示精確匹配 ``` # 精確匹配,必須是127.0.0.1/ location = / { #規則A } # 精確匹配,必須是127.0.0.1/login location = /login { #規則B } ``` ### 以 ^~ 開頭,表示uri以某個常規字符串開頭 nginx不對url做編碼 ``` ## 非精確匹配,并且不區分大小寫,比如127.0.0.1/static/js. location ^~ /static/ { #規則C } ``` ### ~ 開頭,表示區分大小寫的正則匹配 ``` location ~ \.(gif|jpg|png|js|css)$ { #規則D } ``` ### ~* 開頭,表示不區分大小寫的正則匹配 ``` ## 不區分大小寫,匹配.png結尾的 location ~* \.png$ { #規則E } ``` ### !~ 和!~* 分別為區分大小寫不匹配及不區分大小寫不匹配 的正則 ``` ## 區分大小寫,匹配不以.xhtml結尾的 location !~ \.xhtml$ { #規則F } location !~* \.xhtml$ { #規則G } ``` ### / 通用匹配,任何請求都會匹配到 ``` location / { #規則H } ``` ## 匹配順序 首先匹配= ; 其次匹配^~; 再其次是按文件中順序的正則匹配; 最后是交給 / 通用匹配; 當有匹配成功時候,停止匹配,按當前匹配規則處理請求
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看