生產環境常見的HTTP狀態碼列表

200 - OK,服務器成功返回網頁 php

  • Standard response for successful HTTP requests.

301 - Moved Permanently(永久跳轉),請求的網頁已永久跳轉到新位置。html

  • This and all future requests should be directed to the given.
    304(未修改)自從上次請求後,請求的網頁未修改過。服務器返回此響應時,不會返回網頁內容。

若是網頁自請求者上次請求後再也沒有更改過,您應將服務器配置爲返回此響應(稱爲 If-Modified-Since HTTP 標頭)。服務器能夠告訴 Googlebot 自從上次抓取後網頁沒有變動,進而節省帶寬和開銷。 linux

403 - Forbidden(禁止訪問),服務器拒絕請求,此類問題通常是服務器或服務權限配置不當所致。
緣由之一:是nginx配置文件裏沒有配置默認首頁參數,或首頁文件在站點目錄下沒有以下內容:
index index.php index.html index.htm;
緣由之二:站點目錄下沒有配置文件裏指定的首頁文件。
緣由之三:站點目錄或內容的程序文件沒有nginx用戶訪問權限。
緣由之四:nginx配置文件中設置了allow,deny等權限控制,致使客戶端沒有訪問權限。nginx

  • forbidden request (matches a deny filter) => HTTP 403
  • The request was a legal request, but the server is refusing to respond to it.

404 - Not Found,404 - 請求的網頁不存在後端

服務器找不到請求的頁面。可能客戶端服務器上不存在資源所致。服務器

  • The requested resource could not be found but may be available again in the future.

500 - Internal Server Error(內部服務器錯誤),例如selinux開啓,有沒爲其設置許可。ide

  • internal error in haproxy => HTTP 500
  • A generic error message, given when no more specific message is suitable.

502 - Bad Gateway(壞的網關),通常是網關服務器請求後端服務時,後端服務沒有按照http協議正確返回結果。ui

  • the server returned an invalid or incomplete response => HTTP 502
  • The server was acting as a gateway or proxy and received an invalid response from the upstream server.

503 - Service Unavailable(服務當前不可用),可能由於超載或停機維護。503 - 服務器超時code

- no server was available to handle the request => HTTP 503
- The server is currently unavailable (because it is overloaded or down for maintenance).

504 - Gateway Timeout(網關超時),通常是網關服務器請求後端服務時,後端服務沒有在特定的時間內完成服務。server

  • the server failed to reply in time => HTTP 504
  • The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
相關文章
相關標籤/搜索