The solution to nginx 404 not found on the recording website

888u

Last update at :2023-12-28,Edit by888u

This site activated 360 website monitoring on April 24, but has not received any reminder text messages. On the morning of April 28, I saw a text message from 360 website monitoring on my mobile phone. It could not be opened for 2 hours. In addition, One thread could not be opened for 8 minutes, all occurring around early morning. When I saw such a text message reminder, I didn't pay attention because the website could be opened. It was not until around 4 pm on April 28 that I received another text message reminder. I immediately opened the website to see the result prompt: nginx 404 not found. After seeing this prompt, I immediately logged into the control panel and restarted ngnix, PHP, mysql, etc., but it still didn't solve the problem. Restarting the cloud server didn't solve the problem, so I thought of checking what the error log showed, but it didn't turn on, so I immediately Turn on error logging!

In fact, many times blindly looking for answers without knowing where the root cause is is like a quack doctor treating a doctor, just giving medicine indiscriminately without asking anything! Many times when there is a problem with the website, you should check the error message as soon as possible to find out the specific cause. After encountering this incident, this site started error diary recording and found the specific reason!

The error log records hints of such problems:

[crit] 2626#0: *6405 connect() to unix:/tmp/php-cgi-xxx-php5.3-7vps.sock failed (2: No such file or directory) while connecting to upstream, client : 185.103.252.173, server: this site.com, request: "POST /xmlrpc.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-xxx-php5.3-7vps.sock :", host: "www.thissite.com"

Mainly due to improper configuration of php-fpm, the following is the current configuration of this site

[7vps-php5.3-7vps]
listen = /tmp/php-cgi-xxx-php5.3-7vps.sock
listen.group = www
user=www
group=www
pm = static
pm.max_children = 3
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

rlimit_files = 51200

Here are some parameters related to this. They are pm, pm.max_children, pm.start_servers, pm.min_spare_servers and pm.max_spare_servers.

PM indicates which method to use. There are two values ​​to choose from, static or dynamic.

The meanings of the following four parameters are:

pm.max_children: The number of php-fpm processes opened in static mode.
pm.start_servers: The number of starting php-fpm processes in dynamic mode.
pm.min_spare_servers: The minimum number of php-fpm processes in dynamic mode.
pm.max_spare_servers: The maximum number of php-fpm processes in dynamic mode.

If dm is set to static, only the pm.max_children parameter will take effect. The system will start a set number of php-fpm processes.

If dm is set to dynamic, then the pm.max_children parameter will be invalid and the next three parameters will take effect. The system will start pm.start_servers php-fpm processes when php-fpm starts running, and then dynamically adjust the number of php-fpm processes between pm.min_spare_servers and pm.max_spare_servers according to the needs of the system.

This site has chosen the static mode, and the number of pm.max_children processes is set to 3, which is very small. After adjusting the number of pm.max_children processes, no similar problems have occurred so far! Since we are using the paid version of AMH5.x, it is very simple to modify. Just edit and adjust the php-fpm options of the virtual host on the panel!

Through this incident, I understand that there are still many things that I need to learn. People must continue to enrich themselves, otherwise they will be as stupid as they are now!

Recommended site searches: free hosting, registration-free CDN, registered and unregistered domain names, website registration numbers, Hong Kong server hosting, how to register domain names, American space, php virtual space, asp.net virtual host, instant solution server,

The solution to nginx 404 not found on the recording website

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码