503

Service Unavailable

Official Substatus codes
the service is not available

Specification of the HTTP status code 503

The 503 Service Unavailable status code indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. The server MAY send a Retry-After header field to suggest an appropriate amount of time for the client to wait before retrying the request. Note: The existence of the 503 Service Unavailable status code does not imply that a server has to use it when becoming overloaded. Some servers might simply refuse the connection.

Source / Quote by: The 503 Service Unavailable HTTP Status Code is specified by section 6.6.4 of RFC7231.

How to throw a 503 statuscode with PHP?

To throw the HTTP status code 503 on a web page, the PHP function http_response_code can be used. The syntax is as follows: http_response_code(503) (PHP 5 >= 5.4.0, PHP 7, PHP 8)

Test the 503 HTTP status code

In order to be able to display the HTTP status code (in this case 503 Service Unavailable) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:

Status code 503 Service Unavailable
Overview
URL: https://http-statuscode.com/errorCodeExample.php?code=503
Status: 503 Service Unavailable
Those: Network
IP address: XX.XX.XX.XX
Status code 503 Service Unavailable

How to create a custom error page for the 503 status code

Creating your own 503 Service Unavailable error page is relatively easy with the web server "Apache" as well as with the web server "NGINX".

Apache Webserver

The web server "Apache" is one of the most popular web servers on the Internet. To create an own 503 Service Unavailable error page in "Apache", the following change must be made in the following file.

File: .htaccess
ErrorDocument 503 /errors/503.html

NGINX Webserver

Similar to the web server "Apache", "NGINX" is also widely used on the Internet. To create your own 503 Service Unavailable error page in "NGINX", the following change must be made in the following file.

File: sites-enabled/default
error_page 503 /503.html;
location = /503.html {
    root /usr/share/nginx/html;
    internal;
}

Browser compatibility of the 503 status code

Chrome no data
Edge no data
Firefox no data
Opera no data
Safari no data
Chrome Android no data
Firefox for Android no data
Opera Android no data
Safari on iOS no data
Internet no data
WebView Android no data

Constants in programming languages

HttpStatusCode.ServiceUnavailable
http.StatusServiceUnavailable
Response::HTTP_SERVICE_UNAVAILABLE
httplib.SERVICE_UNAVAILABLE
http.client.SERVICE_UNAVAILABLE
http.HTTPStatus.SERVICE_UNAVAILABLE
:service_unavailable

Sub status codes of the 503 status code

Sub status codes are purely technical, and should never be sent to the user. For example, if status code 503.1 is thrown, it may be logged, but status code 503 will be sent to the user.:
503.0 Application pool unavailable.
HTTP IIS, Unofficial
503.2 Concurrent request limit exceeded
HTTP IIS, Unofficial
503.3 ASP.NET queue full
HTTP IIS, Unofficial
503.4 FastCGI queue full
HTTP IIS, Unofficial

Blog Articles

SEO and HTTP status codes: A comprehensive analysis

Optimizing a website for search engines (SEO) is a complex undertaking. One of the often overlooked but crucial aspects for a good ranking are HTTP status codes. These small, three-digit codes info...

Author: Tony Brüser
Author: Tony Brüser

Tony Brüser is an enthusiastic web developer with a penchant for HTTP status codes.

LinkedInGitHub