NGINX 502 Error Resolves by Restarting CSF?

1Engineer

Registered
May 29, 2017
2
0
1
Russia
cPanel Access Level
Root Administrator
Hi everyone,

I have this odd problem I hope someone can help me with


I recently installed CPNGINX on my server. The problem that I have is every 5-10 minutes or so, some of the websites start to throw 502 error.
Oddly, the problem resolves as soon as I restart CSF!
For now, I had to set a cronjob to restart CSF every 2 minutes to avoid this problem. But I know this is an ugly way to get around it.
I have to mention that the firewall features are all disabled on CPNGINX.
I'd be happy to know your opinion on the matter.

Thanks in advance
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello,

I recommend reporting this issue to the developer of the Nginx plugin you are using to determine if it's a known issue and if there's a recommended solution.

That said, you may want to review /usr/local/apache/logs/error_log when you reproduce the error message to see if you notice any particular output.

Thank you.
 

1Engineer

Registered
May 29, 2017
2
0
1
Russia
cPanel Access Level
Root Administrator
Hello,

I recommend reporting this issue to the developer of the Nginx plugin you are using to determine if it's a known issue and if there's a recommended solution.

That said, you may want to review /usr/local/apache/logs/error_log when you reproduce the error message to see if you notice any particular output.

Thank you.
Hello,

Thanks for your reply.
I have reported this problem to the developer and they tweaked the nginx configuration to solve it but it didn't work. The only thing that seems to fix the problem is restarting CSF (I have to mention that oddly enough, the problem happens even if CSF is not active but anyway, doing a restart on CSF always fixes this)

Here are some of the errors that i see in my apache error log around that time (To make it more readable, IPs and domains are removed from the log) :

[proxy_fcgi:error] [pid 663174] [client IP:51373] AH01067: Failed to read FastCGI header, referer:
[proxy_fcgi:error] [pid 663174] (104)Connection reset by peer: [client IP:51373] AH01075: Error dispatching request to : , referer:
[proxy_fcgi:error] [pid 663152] [client IP:56844] AH01067: Failed to read FastCGI header, referer:
[proxy_fcgi:error] [pid 663152] (104)Connection reset by peer: [client IP:56844] AH01075: Error dispatching request to : ,
[proxy_fcgi:error] [pid 663176] [client IP:52425] AH01067: Failed to read FastCGI header, referer:
[proxy_fcgi:error] [pid 663176] (104)Connection reset by peer: [client IP:52425] AH01075: Error dispatching request to : , referer:
[proxy_fcgi:error] [pid 663174] [client IP:51373] AH01067: Failed to read FastCGI header, referer:
[proxy_fcgi:error] [pid 663152] [client IP6:56844] AH01067: Failed to read FastCGI header, referer:
[proxy_fcgi:error] [pid 663174] (104)Connection reset by peer: [client IP:51373] AH01075: Error dispatching request to : , referer:
[proxy_fcgi:error] [pid 663152] (104)Connection reset by peer: [client IP:56844] AH01075: Error dispatching request to : , referer:
[proxy:error] [pid 663142] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/7dd95bd189b1408f3de1411e60838d06a653c126.sock (*) failed
[proxy_fcgi:error] [pid 663142] [client IP:50122] AH01079: failed to make connection to backend: httpd-UDS, referer:
[proxy:error] [pid 663142] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/7dd95bd189b1408f3de1411e60838d06a653c126.sock (*) failed
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello,

Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look. You can post the ticket number here and we will update this thread with the outcome.

Thank you.