Some common status codes HTTP5XX Solutions

500 error (Internal Server Error)

500 error refers to a server internal error, that is, the server encountered an unexpected condition and can not fulfill the request.

 

Generally there are several situations:

 

1.web script errors, such as php syntax errors, lua syntax errors.

2. Sheremetyevo time, due to system resource constraints, but not too many open files

 

General analysis ideas:

 

1. Check the nginx error log, see the php error log

2. If you are too many open files, modify the parameters worker_rlimit_nofile nginx using ulimit view the system open file limit, modify /etc/security/limits.conf

3. If the problem is the script, you need to repair a script error, and optimized code

4. Various optimizations have to do, too many open files is still there, it would have to consider doing load balancing, the traffic into different servers go up

 

Error 502 (Bad Gateway) 504 and the error (Gateway Timeout)

Resulting in several cases 502, 504:

 

1. nginx proxy server fails rear end;

2.php-cgi number of processes is not enough;

3.php execution for a long time, or php-cgi processes die;

4. fastCGI the like has been performed.

 

502 Bad Gateway refers to php-fpm request has been executed, but for some reason has not been completed, resulting in php-fpm process terminates.

In general, the php-fpm.conf setting is also about the implementation of the program performance of php, visit the Web site is larger, and the number of php-cgi process less than normal. 502 error for this case, simply increase the number of php-cgi process.

Concrete is modified /usr/local/php/etc/php-fpm.conf file, which will be max_children appropriate increase in value.

This data should be set depending on the configuration of your VPS or a dedicated server. On average, a php-cgi process accounted 20M memory, you can calculate yourself under, the amount of the increase.

/ Usr / local / php / sbin / php-fpm restart and then restart it.

 

504 represents a timeout, the request is not issued by the client to the gateway, a request may not be performed php-fpm.

 

503错误(Service Unavailable)

Due to a temporary overloading or server maintenance, server is currently unable to handle the request. Usually this is temporary, and will be for some time to recover.

 

Sometimes a single ip concurrent set too low can lead to 503 error.

Guess you like

Origin blog.csdn.net/zhydream77/article/details/91959295