• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Nginx error each hour (502) peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream

Lrnt

Basic Pleskian
Hi,

Sine a little time, I have an nginx error each hour (at HH:58:00) which result in a 502 Bad Gateway during 10-15 second.

I really don't know where it comes from?

Before turning of nginx, maybe someone will have an good idea?

Here is a the part of the nginx log when the error occurs:
Code:
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482905 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482905 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482909 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482911 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482913 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482915 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482917 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482919 connect() failed (111: Connection refused) while connecting to upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482921 connect() failed (111: Connection refused) while connecting to upstream                Erreur Nginx
2021-06-12 21:58:05    Error    XX.XXX.XXX.XXX        31293#0: *3482923 connect() failed (111: Connection refused) while connecting to upstream                Erreur Nginx
2021-06-12 21:58:10    Error    XX.XXX.XXX.XXX        31781#0: *3482927 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:10    Error    XX.XXX.XXX.XXX        31781#0: *3482929 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:10    Error    XX.XXX.XXX.XXX        31781#0: *3482931 connect() failed (111: Connection refused) while connecting to upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482937 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482941 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482943 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482948 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482950 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:14    Error    XX.XXX.XXX.XXX        32272#0: *3482952 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:19    Error    XX.XXX.XXX.XXX        300#0: *3482975 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:19    Error    XX.XXX.XXX.XXX        765#0: *3482977 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:19    Error    XX.XXX.XXX.XXX        765#0: *3482977 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:19    Error    XX.XXX.XXX.XXX        765#0: *3482980 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:19    Error    XX.XXX.XXX.XXX        765#0: *3482980 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:20    Error    XX.XXX.XXX.XXX        765#0: *3482987 upstream prematurely closed connection while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:23    Error    XX.XXX.XXX.XXX        1238#0: *3482991 recv() failed (104: Connection reset by peer) while reading response header from upstream                Erreur Nginx
2021-06-12 21:58:23    Error    XX.XXX.XXX.XXX        300#0: *3482975 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream                Erreur Nginx
2021-06-12 21:58:23    Error    XX.XXX.XXX.XXX        1238#0: *3482993 connect() failed (111: Connection refused) while connecting to upstream                Erreur Nginx

  • The server is Debian 9.13
  • This website uses HTTPS Let's Encrypt Certificate
  • This website has a dedicated IP
  • This website has a "webapp" running on HTTP (Mandatory due to external hardware reachable through unsecure ws://)
  • Nginx has proxy mod enabled
I try to increase nginx buffer but it did not change anything (proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; )
Thanks in advance for yours advices.
 
Wow ! Just found this in the crontab:
Code:
/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/sslit/scripts/keep-secured.php'
which is executed each hour at 58 MINUTES

Do you think 502 bad gateway errors come from that?
Is it safe to disable ? Or can I uninstall SSL It! and just keep Let's Encrypt! ?

Will my Let's Encrypt Certificates still be renew? (There also a cronjob "/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/letsencrypt/scripts/keep-secured.php'"

Thanks.
 
Note - I would have solution #2 in place anyways. Very few, if any, reasons not to use graceful restarts
 
Back
Top