Answers in the range 100-199 are informational. They indicate that the client's request has been accepted and is being processed.

100 ="Continue"
The initial part of the request has been accepted and the client may continue to send the request.
101 ="Switching protocols"
The server honors the client's request and switches protocols as indicated in the Upgrade header field.

Client request successful (Successful 2xx)

Responses in the range 200-299 indicate that the client's request was processed successfully.

200 ="OK"
The client request was processed successfully and the server response contains the requested data.
201 ="Created"
This status code is used when a new URI is created. Along with this result code, the server returns a Location header (see Chapter 19) that contains information about where the new data was placed.
202 ="Accepted"
The request was accepted, but not immediately processed. In the content body of the server response can be given Additional Information about this transaction. There is no guarantee that the server will eventually grant the request, even though the request looked valid at the time it was received.
203 ="Non-Authoritative Information"
The content header information is from a local copy or from a third party, not from the origin server.
204 ="No content"
The response contains a status code and a header, but no content body. The browser should not update its document when this response is received. A sensitive image handler can return this code when the user clicks on useless or empty areas of the image.
205 ="Reset Content"

The browser must clear the form used in this transaction for additional input. Useful for CGI applications that require input.

206 ="Partial Content"

The server returns only a portion of the requested amount of data. Used in response to a request with a Range header. The server MUST indicate the range included in the response in the Content-Range header.

233 - because not everyone lives in "your country"

Client request redirected (Redirection 3xx)

A response code in the range 300-399 indicates that the request failed and the client needs to take some action to satisfy the request.

300 ="Multiple Choices"
The requested URI designates more than one resource. For example, a URI might refer to a document that has been translated into multiple languages. The content body returned by the server may contain a list of more specific information about how to select the correct resource.
301 ="Moved Permanently" - moved permanently
The requested URI is no longer in use by the server, and the requested operation failed. The new location of the requested document is indicated in the Location header. In all subsequent requests this document the new URI should be specified.
For non-HEAD requests, the server MUST send a hypertext explanation in the body of the message. When using all methods except GET and POST, you must first notify the user about the change in the link. Do not forget that some agents mistakenly change POST method to GET after moving to another address.
302 ="Moved Temporarily" - temporarily moved
The requested URI has been jumbled, but only temporarily. The Location header points to the new location. Immediately upon receiving this status code, the client MUST resolve the request with the new URI, but all subsequent requests MUST use the old URI.
For all methods except HEAD, the server MUST send a hypertext explanation in the body. When using all methods other than GET and POST, you must first notify the user about the URI change. When accessing the next resource, the POST method should be changed to GET, as some agents do.
303 ="See Other"
The requested URI can be found by another URI (specified in the Location header). It should be selected using the GET method for this resource.
304 ="Not Modified"

This is the response code for the lf-Modified-Since header if the URI has not changed since the specified date. The content body is not sent, and the client must use its local copy.

305 ="Use proxy"

The requested URI must be accessed through the proxy specified in the Location header.

306 ="(Unused)" 307 ="Temporary Redirect"

The client request is incomplete (Client Error 4xx)

Response codes in the range 400-499 indicate that the client's request is incomplete. These codes may also indicate that additional information is required from the client.

400 ="Bad Request"
Indicates that the server encountered a syntax error in the client's request.
401 ="Unauthorized" - authorization required
This result code, sent with the WWW-Authenticate header, indicates that the requesting user does not have the required authority, and that the user must grant such authority if the request is repeated with the given URI.
402 ="Payment Required"
This code has not yet been implemented in HTTP.
403 ="Forbidden"
The request was rejected because the server is unwilling (or unable) to respond to the client.
404 ="not found" - not found
The document at the specified URI does not exist.
405 ="Method Not Allowed" - method is not supported
This code is issued with an Allow header and indicates that the method used by the client is not supported for the given URI.
406 ="Not Acceptable"
The resource specified by the client at the given URI exists, but not in the format that the client wants. Along with this code, the server issues the Content-Language, Content-Encoding, and Content-Type headers.
407 ="Proxy Authentication Required" The proxy server has requested authorization.
The proxy server must authorize the request before forwarding it. Used with the Proxy-Authenticate header.
408 ="Request Time Out"
This response code means that the client did not send complete request for some set amount of time (which is usually set in the server configuration) and the server breaks network connection.
409 ="Conflict"
This request conflicts with another request or with a server configuration. Information about the conflict should be returned in the information part of the response.
410 ="Gone"
This code indicates that the requested URI no longer exists and has been permanently removed from the server.
411 ="Length Required"
The server will not accept a request without a Content-Length header specified in it.
412 ="Precondition Failed"
The result of evaluating the condition specified in the request by one or more if headers. . ., represents "false".
413 ="Request Entity Too Large"
The server will not process the request because its body is too large.
414 ="Request-URI Too Long" - the request is too long
The server will not process the request because its URI is too long.
415 ="Unsupported Media Type"

The server will not process the request because its body is in an unsupported format.

416 ="Requested Range Not Satisfiable"

The requested range is not valid

417 ="Expectation Failed"

The wait failed

422 ="Unprocessable Entity" - the server successfully accepted the request, can work with the specified type of data (for example, the request body contains an XML document with the correct syntax), but there is some kind of logical error due to which it is impossible to perform an operation on the resource .
Used on some systems to send a request for additional data: NOT ENOUGH DATA (not enough data) 429 ="You exceeded the rate limit"

Request limit exceeded

449 - Retry with a proxy in another country. 450 =Rating Service Unavailable 451 =Unavailable For Legal Reasons

access to the resource is limited due to problems with the law. 451 - Site is not permitted in your country

452 could be site not permitted by employer, 453 could be site not permitted by ISP 460 Blocked by Repressive Regime

Server Errors (Server Error 5xx)

Response codes in the range 500-599 indicate that the server has encountered an error and is likely unable to complete the client's request.

500 ="Internal Server Error"
While processing a request on the server, one of its components crashed or encountered a configuration error. Often associated with errors in the .htaccess file
501 ="Not Implemented"
The client has requested an action that the server cannot perform.
502 ="Bad Gateway"
The server (or proxy) received invalid responses from another server (or proxy).
503 ="Service Unavailable"
This code means that this service is temporarily unavailable, but access to it will be restored in the future. If the server knows when this will happen, a Retry-After header may also be issued.
504 ="Gateway Time Out"
This response is similar to 408 (Request Time-out), except that the gateway or authoritative server has timed out.
505 ="HTTP version not supported"

The server does not support the HTTP protocol version used in the request.

560 - Server is being censored

Errors (Error 7xx)

701 - Your ISP is being a twat. 702 - Your organization is being a twat. 703 - Your government is being a twat 704 - Your ISP is being a twat, and has messed with your DNS request, sending you to a spamvertizement for the domain requested. 705 - Your ISP is throttling / packet shaping the living hell out of your connection. 706 - Variant HTML requested (mobile, Flash-free....lots of flags in here). 707 - The current server time (in ticks since the epoch) & the server's time zone.

Errors (Error 9xx)

911 - Internet emergency. The provider of this connection is being forced to censor this request

To send a status code from PHP, use the directive " header Status ".


.

When accessing a web server or application, each incoming HTTP request receives an HTTP status code as a response. HTTP status codes are three-character codes grouped into five different classes. The status code class can be identified by the first digit:

  • 1xx - information codes;
  • 2xx - success;
  • 3xx - redirect;
  • 4xx - client error;
  • 5xx - server error.

This guide focuses on identifying and resolving the most common HTTP error codes (i.e. 4xx and 5xx status codes) from a system administrator's perspective. In some situations, the web server responds to a request with a specific error code; consider general possible reasons and solutions.

Brief overview of client and server errors

Client errors (HTTP status codes 400-499) are caused by HTTP requests sent by the client (web browser or other HTTP client). Although these types of errors are related directly to the client, system administrator it is useful to know what error codes a user might encounter in order to determine if the problem can be solved in the server configurations.

Server errors (HTTP status codes 500-599) occur when the web server is unable to process a request due to some kind of error or failure.

  • When using a web browser to test a web server, be sure to refresh your browser after making changes to the server settings.
  • Check the server logs for details on how the server handles requests. For example, the Apache and Nginx web servers create two files called access.log and error.log where you can find the relevant information.
  • Remember, HTTP status code definitions are part of a standard that is implemented by the requesting application. This means that the actual status code that is returned as a result depends on how software server handles the specific error.

With the basic concepts of HTTP status codes out of the way, let's take a look at the most common errors.

Error 400 Bad Request

Status code 400, or bad error Request ("bad request") means that the syntax of the HTTP request sent to the server is incorrect.

As a rule, the causes of the 400 Bad Request error are as follows:

  • The user's cookies associated with the site are corrupted. To resolve this issue, try clearing your browser cache and cookies.
  • A malformed request due to a faulty browser.
  • A malformed request due to a user error when manually generating an HTTP request (for example, improper use of curl).

Error 401 Unauthorized

The 401 status code, or Unauthorized error, means that the user trying to access the resource was not authorized (or was unable to authenticate with incorrect credentials). To be able to view a protected resource, the user must provide valid credentials.

For example, a 401 Unauthorized error might occur if the user is trying to access a resource that is protected by HTTP authorization (as in this one). In such a situation, the 401 error will appear again and again until the user provides the correct username and password (which is included in the .htpasswd file).

Error 403 Forbidden

The 403 status code, or Forbidden error, means that the user's request was sent correctly, but the server refuses to serve it due to lack of permission to access the requested resource. This section describes the most common causes of a 403 error.

File permissions

Typically, a 403 error occurs if the user running the web server process does not have read permissions for the requested file.

To give an example of troubleshooting a 403 error, let's assume that:

  • the user is trying to access an index file (http://example.com/index.html);
  • the web server worker process is owned by the www-data user;
  • The index file on the server is located at /usr/share/nginx/html/index.html.

So, if the user is getting a 403 Forbidden error, make sure the www-data user has permissions to read the file. As a rule, in such a situation, you just need to change the permissions on the file. This can be done in several ways, but in this case, this command will do:

sudo chmod o=r /usr/share/nginx/html/index.html

.htaccess file

Another potential cause of a 403 error (often by design) is the use of an .htaccess file. Using the .htaccess file, you can prevent specific IP addresses (or ranges of addresses) from accessing certain resources.

If users are unexpectedly getting a 403 Forbidden error, make sure it's not caused by a setting in the .htaccess file.

Non-existent index file

If a user tries to access a directory that does not have a standard index file, and directory listing is disabled, the web server will return a 403 Forbidden error. This will happen if, for example, the user tries to access the http://example.com/emptydir/ directory and there is no index file in the emptydir directory on the server. Directory listing can be enabled in server configurations.

Error 404 Not Found

Status code 404, or Not error Found ("not found") means that the user can interact with the server, but the required file or resource is missing.

404 errors can occur in a wide variety of situations. Below is a list of tips to help troubleshoot the issue if the user unexpectedly receives a 404 Not Found:

  • Check the link that directs the user to the server for errors or typos.
  • The user may have entered an invalid URL.
  • May be, desired file does not exist at the specified location on the server; make sure the requested resource has not been moved or removed from the server.
  • Check if the location of the root directory (document root) in the server configuration is correct.
  • It is possible that the user who owns the web server worker process does not have the appropriate rights to open the directory that contains the requested file. Access to the directory requires read and execute permissions.
  • If the user navigates to a resource via a symbolic link, make sure the web server is configured to support symbolic links.

Error 500 Internal Server Error

The 500 status code, or Internal Server Error error, means that the server cannot process the request for an unknown reason. Sometimes this code appears in situations where other 5xx error messages are more appropriate.

As a rule, the cause of this error is an incorrect server configuration (for example, a corrupted .htaccess file) or a lack of some packages (for example, running PHP file without PHP pre-installed).

Error 502 Bad Gateway

The 502 status code, or Bad Gateway error, means that the requested server is a gateway or proxy server and is not receiving valid responses from the backend servers that actually made the request.

If it's a reverse proxy (for example, a load balancer), make sure that:

  • the backend servers (to which HTTP requests are forwarded) are fine;
  • the reverse proxy is configured correctly, the correct backends are specified in its settings;
  • the network connection between the backend servers and the reverse proxy is fine. If servers can communicate on other ports, make sure those ports are not blocked by the firewall;
  • the desired sockets exist in the correct location and have the appropriate permissions (if the web application is configured to listen on sockets).

Error 503 Service Unavailable

The 503 status code, or Service Unavailable error, means that the server is overloaded or under maintenance; such a service should become available over time.

If the server is not under maintenance, this error may indicate that the server does not have enough processor or memory resources to process all incoming requests, or that the web server needs to be tuned to serve more users or processes.

Error 504 Gateway Timeout

The 504 status code, or Gateway Timeout error (“gateway is not responding”) means that given server is a gateway or proxy and it does not receive a response from the backend within the allowed time period.

As a rule, this happens for the following reasons:

  • Poor network connection between servers;
  • The backend server that is executing the request is too slow;
  • The server settings are configured to wait too short for the gateway or proxy server.

Conclusion

Now you are familiar with the basic HTTP error codes and know some ways to solve these problems.

If you encounter an error that was not covered in this article, or know of other convenient ways to resolve HTTP errors, please describe them in the comments below.

Tags: ,

The Internet is not a place where everything functions properly and reliably. Writing software when is not an easy and quite creative task, and if everything works fine, it means that the errors simply did not manifest themselves. There is no program without errors, almost every computer user knows this. Some mistakes are simple and understandable to us, while others raise questions. The 401 error is a popular failure that users don't understand.

Authorization

One of the most annoying processes on websites is authorization. Going through it over and over again is inconvenient, and the passwords saved in the cache memory sometimes disappear. Have to restore.

If the login or password is entered incorrectly, the system does not allow the user to access the resource. This is familiar to everyone, and many know how to overcome it. In technical parlance, this is called a 401 error.

The required username or password is incorrect. Such a user does not exist. You can call it whatever you like, the essence of the problem remains unchanged. Each user is required to enter specific data when logging into their account. Otherwise passive system protection of personal data will not provide access.

Error 401 can occur not only because the user made a mistake in the password or forgot it. It happens that Account is deleted by the resource administrator by mistake, or the system has experienced a major failure. In this case, the user needs to write to technical support resource.

Error error strife

Despite the fact that this error has only one root - problems with authorization, there are varieties. Typically, the system tells the user exactly what happened.

Error 401 is a common name. It reflects the essence of the problem, but different applications it can manifest itself in different ways and even be called differently. There will always be a digital designation, but the word "error" can be replaced with another word or even with an incomprehensible code.

Problems in the green bank

This mistake has gained particular popularity in Russia, largely due to the green bank, which is always nearby. Once, in one of the subjects of the Russian Federation, an unpleasant situation happened - thousands of users could not pass authorization in the bank's application. Srve0295e error 401 - this inscription was seen by many on the smartphone screen. The reason for this error is still unclear. Most likely this is either a problem with the bank or with the provider. If an error occurs, it is recommended to immediately call technical support, or even better - the provider.


Manually editing the Windows registry to remove invalid Authorization Required keys is not recommended unless you are PC service professional. Mistakes made while editing the registry can render your PC unusable and cause irreparable damage to your operating system. In fact, even a single comma in the wrong place can prevent your computer from booting up!

Because of this risk, we highly recommend using a trusted registry cleaner such as Reimage (developed by Microsoft Gold Certified Partner) to scan for and fix any issues related to Error 401. By using a registry cleaner, you can automate the process of finding corrupted registry entries, references to missing files (for example, causing an Authorization Required error) and broken links within the registry. Before each scan, an automatically created backup copy, which allows you to undo any changes with one click and protects you from possible damage computer. The best part is that fixing registry errors can drastically improve system speed and performance.


Warning: If you are not experienced user PC, we do NOT recommend editing the Windows registry manually. Incorrect use of the Registry Editor can lead to serious problems and require reinstalling Windows. We do not guarantee that problems resulting from misuse of Registry Editor can be resolved. You use the Registry Editor at your own risk.

Before manually restoring Windows registry, you need to create a backup by exporting a part of the registry related to Authorization Required (eg. Windows Operating System):

  1. Click on the button To begin.
  2. Enter " command" in search bar... DO NOT PRESS YET ENTER!
  3. Holding keys CTRL-Shift on the keyboard, press ENTER.
  4. An access dialog will be displayed.
  5. Click Yes.
  6. The black box opens with a blinking cursor.
  7. Enter " regedit" and press ENTER.
  8. In the Registry Editor, select the Error 401-related key (eg. Windows Operating System) you want to back up.
  9. On the menu File select Export.
  10. Listed Save to select the folder where you want to save the backup Windows key operating system.
  11. In field File name enter a name for the backup file, such as "Windows Operating System Backup".
  12. Make sure the field Export Range value selected Selected branch.
  13. Click Save.
  14. The file will be saved with .reg extension.
  15. You now have a backup of your Authorization Required-related registry entry.

The next steps for manually editing the registry will not be covered in this article, as they are likely to damage your system. If you would like more information on editing the registry manually, please see the links below.

Sometimes, when performing internal site optimization, the software encounters getting 401 unauthorized errors on some pages. For high-quality site promotion, it is very desirable that the search robot on all crawled pages receive either a 200 or 301 response, which should still redirect it to a page with a 200 code.

What are the possible reasons for the 401 error to appear?

  • server performance problems
  • local PC user problems
  • problems with your internal scripts

If there is a problem with the server, you just need to take a screenshot of the error and send it along with the addresses of the problematic pages to the hosting support service, where, in the presence of quality service, you should be promptly helped to solve the problem.

If the problem is in your scripts, then the support will not help you much. The first step is to close all pages that are available only to registered users from indexing in robots.txt. Next, we need to configure the correct response code 200 on problem pages and save all the functionality of the site. by the most simple option The solution to the problem will be setting up a 301 redirect from the page with the 401 code to the page with the registration form, after passing which we again redirect the user to the page he is looking for. A more difficult option would be to set up a special java script, which, when the user clicks on the link that requires authorization, will display on the same page a window for entering a login and password, after filling in which the user will be given the page he requested.

If the user is registered but still receives a 401 response code, then most likely the access levels for of this type user, or the duration of the user session before automatic logout is very short. To extend the duration of the user session, we find the php.ini file on the server and increase the value for the following two parameters: session.gc_maxlifetime and session.cookie_lifetime.