Web Firewalls often encounter all kinds of status codes , The customer doesn't know why . According to the official documents , Sort out all the HTTP Status code and its meaning , And the common handling methods of abnormal status code , Improve the efficiency of problem handling .
Reference documents ：https://www.restapitutorial.com/httpstatuscodes.html
Due to part 4xx and 5xx More status codes , And I haven't met , So the part didn't write , If you need to see all of them, please refer to the reference documents
Let's talk about the meaning of each status code ：
1xx Request process or protocol conversion
2xx Request succeeded
3xx The request has been transferred
4xx The request cannot reach the server , Or the server refused
5xx Request to server , The server didn't want to respond or something went wrong with the response
Common in websocket, Protocol conversion
301 Permanent transfer , In short, the website before the transfer is gone
302 A temporary transfer , The site before the transfer is still , such as http Jump to https General use 302
difference ： encounter 301 The search engine grabs new content when it's done , And put on a new one URL; encounter 302 when , Because it's temporary , Search engines grab new content , Keep the original URL
307 The definition of is actually and 302 It's consistent , The only difference is that ,307 The status code does not allow the browser to change the original POST The request for is redirected to GET On the request .
308 And 301 The definitions are the same , The only difference is ,308 The status code does not allow the browser to change the original to POST The request of the top to GET On the request .
400 yes bad request, Generally speaking , What happens is web The server has no corresponding configuration , For example, there is no domain name configured , No corresponding protocol is configured （http/https No, but use corresponding access ）
unauthorized , such as nginx Configured account password access , But I didn't enter the password
Blocking access , such as nginx Configured with deny, perhaps WAF Interception is configured
Resources not found , It's common that the path is incorrect , Or used websocket My website is not open websocket function
The client actively disconnects , Generally, this status code appears , You need to check whether there is a problem with the client network , The timeout configuration is too short
web Internal error in service , It depends on each web Error log for service , For example, the operating system has too many open files , Script syntax errors and so on
The server returned an exception ,web Servers are often accompanied by recv() failed (104: Connection reset by peer) while reading response header from upstream Similar logs , Common reasons like php I can't handle the request , Or when the proxy forwards to the back end, the security group is not open
Service not available , Common in apache, For example, the number of connections is not enough
This is just a brief description of the problems we encounter everyday , Continue to update later .
Original statement , This article is authorized by the author + Community publication , Unauthorized , Shall not be reproduced .
If there is any infringement , Please contact the email@example.com Delete .