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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## **1、Nginx拋出404,返回給客戶端404** ``` server { listen 80; server_name # 定義錯誤頁面碼,如果出現相應的錯誤頁面碼,轉發到那里。 error_page 404 403 500 502 503 504 /404.html; location / { root /var/www/test; index index.html index.htm; } # 承接上面的location。 location = /404.html { # 放錯誤頁面的目錄路徑。 root /usr/share/nginx/html; } } ``` ## **2、反向代理的錯誤頁面** ``` upstream www { server 192.168.1.201:7777 weight=20 max_fails=2 fail_timeout=30s; ip_hash; } server { listen 80; server_name www.test.com; root /var/www/test; index index.html index.htm; error_page 404 /404.html; location / { try_files $uri @test; } location @test { if ($request_uri = /){ rewrite ^(.*)$ /index.html last; } # 關鍵參數:這個變量開啟后,我們才能自定義錯誤頁面,當后端返回404,nginx攔截錯誤定義錯誤頁面 proxy_intercept_errors on; proxy_pass http://www; proxy_set_header HOST $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-FOR $proxy_add_x_forwarded_for; } location ~* \.(gif|jpg|jpeg|png|css|js|ico|html)$ { gzip on; gzip_http_version 1.0; gzip_types application/javascript text/css image/jpeg; proxy_set_header Accept-Encoding 'gzip'; add_header X-Frame-Options 'SAMEORIGIN'; add_header abc '132'; root /usr/share/nginx/html/; index index.html; } } ``` ## **3、Nginx解析php代碼的錯誤頁面** 如果后端是php解析的,需要加一個變量 在http段中加一個變量 fastcgi_intercept_errors on 就可以了。 指定一個錯誤頁面: ``` error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } ``` 指定一個url地址: ``` error_page 404 /404.html; error_page 404 = http://www.test.com/error.html; ```
                  <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>

                              哎呀哎呀视频在线观看