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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                一直在懵逼nginx 的路由配置,經過今天幾個小時的努力這次終于弄明白了。 如果有不對的地方,希望有前輩指出錯誤,讓我更上一層樓,也讓我別再錯誤的道路上越走越遠。 1.index 我的理解是默認路徑,也就是當找不到文件的時候的一個默認的路徑,可以配置多個。 具體的用法稍后說,請先記住這個東西當你找不到其他合適的東西,默認給你分配的。 2.location 這個東西匹配你需要的路徑 [圖片上傳失敗...(image-142a00-1527905370923)] server { ? ? ? ? listen 80; ? ? ? ? server_name localhost; ? ? ? ? root html/; ? ? ? ? index index.html index.htm index.php; ? ? ? ? location / { ? ? ? ? ? ? try_files $uri $uri/ /index.php?$args; ? ? ? ? ? ? proxy_pass http://www.baidu.com; ? ? ? ? } ? ? ? ? location ~ \.(html|htm)$ { ? ? ? ? ? ? try_files $uri = 404; ? ? ? ? } ? ? ? ? location ~ \.php$ { ? ? ? ? ? ? try_files $uri = 404; ? ? ? ? ? ? include fastcgi.conf; ? ? ? ? ? ? fastcgi_pass 127.0.0.1:9000; ? ? ? ? } ? ? } 你可以匹配你需要的所有的uri 想要具體了解的話。http://www.nginx.cn/115.html 3.try_files 這個東西是重定向用的,我感覺和index 差不多,不過確實比index 要好用 舉個例子: 訪問:xf.com/aa 如果我們這么設置,對于這一句的理解是。 try_files $uri $uri/ /index.php?$args; 當nginx 收到你的xf.com/aa ,那么會匹配到? location / { ? ? ? ? ? ? try_files $uri $uri/ /index.php?$args; ? ? ? ? ? ? proxy_pass http://www.baidu.com; ? ? ? ? } 這里多說一嘴,如果沒有合適的匹配,那么就會找index的值。 index.html inde.htm index.php 當找到相對應的文件,就會把你的訪問url變成。 xf.com/index.html或者xf.com/index.htm??xf.com/index.php 其中一個 這回你明白index了吧 回來我們再說? try_files 當匹配到這項的時候,就開始執行try_files nginx 回去找有沒有 aa這個文件($uri) 如果沒有 繼續找aa這個目錄($uri/) 如果也沒有的話就直接 重定向到? ?/index.php?$args? ?? $args 就是你的url 問號后邊的參數 總結: nginx 獲取到url?? 1.找server_name 2.找locationpipei 如果沒有找index默認的文件 如果沒有直接404 有的話加上默認的index.* 重新尋找匹配的location 如果有進入執行try_files 3.查找try_files 是否有相應的文件 如果沒有直接重定向最后一項
                  <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>

                              哎呀哎呀视频在线观看