<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <dfn><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code></dfn> は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>側のエラーによって<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>を処理できなかったことを示す<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">状態符号</anchor>群です。</p><figure class="short list"><ul><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">500</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">501</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">502</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">503</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">504</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">505</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">507</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">508</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">510</anchor></code></li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">511</anchor></code></li><li><code>514</code></li></ul></figure><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <strong><cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-08-07 05:54:02 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7231#section-6.6">https://tools.ietf.org/html/rfc7231#section-6.6</anchor-external></strong></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="507" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[507]</anchor-end> <cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-08-07 05:54:02 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7231#section-7.1.1.2">https://tools.ietf.org/html/rfc7231#section-7.1.1.2</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>自身が異常であると気づいていることや、
指定された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メソッド</anchor>を実行できないことを示します <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;8</anchor-internal></src>。</p></section><section><h1>構文</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>は、<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HEAD</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メソッド</anchor>の場合を除き、
エラーの状態の説明やそれが一時的なものか永続的なものかの説明を含む<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>を送信する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">べきです</strong></anchor>
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;8</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="508" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[508]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> では <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Date:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">生成</anchor>しなくても良いとされています
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="507" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;507</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="509" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[509]</anchor-end> <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>の異常状態を表すことがあるので、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時刻</anchor>を正しく得られない可能性を考慮してのことでしょう。</comment-p></section><section><h1>状態符号の決定</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">4xx</anchor></code> を参照。</p></section><section><h1>処理</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>が含まれていれば<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者</anchor>に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表示</anchor>する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">べきです</strong></anchor>
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;8</anchor-internal></src>。</p></section><section><h1>歴史</h1><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> RFC 1945 (HTTP/1.0) 9.5; RFC 2068・RFC 2616 (HTTP/1.1) 10.5 Server Error 5xx</figcaption><blockquote><p>Response status codes beginning with the digit &quot;5&quot; indicate cases in
which the server is aware that it has erred or is incapable of
performing the request. <del>If the client has not completed the request when a 5xx code is received, it should immediately cease sending data to the server.</del>
Except when responding to a HEAD request, the server <del>should</del> <ins>SHOULD</ins>
include an entity containing an explanation of the
error situation, and whether it is a temporary or permanent condition. <ins>User agents SHOULD display any included entity to the user.</ins> These response codes are applicable to any request method <del>and there are no required header fields</del>.</p></blockquote><p>数字 <code class="HTTP">5</code> で始まる状態符号は、
サーバーが、自身が誤っているか又は要求を処理する能力がないと知っている場合を示します。 <del><code class="HTTP">5<var>xx</var></code> 符号を受信した時にクライアントがまだ要求を完了させていなければ、クライアントは即座にサーバーにデータを送信するのを止めるべきです。</del>
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HEAD</anchor></code> 要求への応答を除いて、サーバーは誤りの状況とそれが一時的な状況なのか永続的な状況なのかの説明を含めた実体を含める<strong>べきです</strong>。 <ins>利用者エージェントは、含まれている実体を利用者に表示する<strong>べきです</strong>。</ins>
これらの応答符号はどの要求 method にも適用可能です<del>し、必須の頭欄はありません</del>。</p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">注 : 修正はすべて 1945 → 2068 の差分。</p></insert></figure><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r7634     Since this made it likely that overloaded servers would just get even more overloaded, pull back a little and let all 5xx errors stop EventSource reconnects. It still reconnects if the connection drops, though. (Compat: 5xxs don't cause reconnects in deployed browsers currently as far as I can tell.)</cite>
( (<time>2013-01-03 07:23:00 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://html5.org/tools/web-apps-tracker?from=7633&amp;to=7634">http://html5.org/tools/web-apps-tracker?from=7633&amp;to=7634</anchor-external></li></ul></refs></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="506" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[506]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>に関するエラーを表す <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">4xx</anchor></code>
に対して、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>側のエラーを表します。
通常は <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> エラーに対して<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>側で対処する方法はありません。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="510" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[510]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>は、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>だけでなく、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>が <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">5xx</anchor></code> すら返せない状況や、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">下位層プロトコル</anchor>のエラーも想定して対応できなければなりません。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP接続</anchor>も参照。</comment-p></section></body></html>