[FIXED BUG] Websites show 502 Bad Gateway after enabling nginx on a server with Fail2ban

Follow

Comments

16 comments

  • Avatar
    Olosz Andor

    This solution is worked for me (Plesk 17.0.17)

    Thank you! :)

    0
    Comment actions Permalink
  • Avatar
    Kingsley Felix

    did not help

    0
    Comment actions Permalink
  • Avatar
    Pavel Mikhaylov

    Hello iamkingsleyf,

    Could you clarify a few moments, please:

    1. Did the symptoms match entirely to ones you were having? 502 error is quite general and solutions may vary, depending on the additional symptoms.
    2. Does the issue still persist or did you manage to resolve it by other means?

    If the issue is not resolved, I would like to recommend to contact our support: https://www.plesk.com/contact-support

    0
    Comment actions Permalink
  • Avatar
    Unknown User

    I have this problem in my server, The bug have not fixed.

    However, I add my server IP to trusted IP list, That is ok, now.

    Here is my server information

    OS CentOS Linux 7.4.1708 (Core)
    Product Plesk Onyx
    Version 17.5.3 Update #45, last updated on April 16, 2018 10:36 AM
    0
    Comment actions Permalink
  • Avatar
    Pavel Mikhaylov

    Hello Lok Ming Chu,

    As the article states:

    Note: Even if the latest micro update of Plesk 17.5 is installed, the issue may persist if fail2ban and IP addresses were configured on the server before 19 MU. In this case, apply the 1st and 2nd steps.

    If this is the case, you have applied the correct solution.

    Thanks.

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Parahoster / Thibaut Robert
    Such error means that iptables service was not restarted properly: it ended up in some error. Check the "service iptables status" output for more information on the cause

    0
    Comment actions Permalink
  • Avatar
    Cesc

    I find nginx-botsearch.conf and nginx-http-auth in /usr/share/doc/fail2ban/dist-config

    How can I do to run this jails in my plesk server,
    Can you help me with files to modify o create?

    Thank you

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Cesc
    You may do this:
    cp -a /usr/share/doc/fail2ban-0.9.6/dist-config/filter.d/nginx-botsearch.conf /etc/fail2ban/filter.d/
    After that, the jail appears in Plesk.
    Or you may refer to this article for detailed steps on how to do it via Plesk interface: https://support.plesk.com/hc/en-us/articles/115000167913-How-to-create-jail-in-Fail2ban-

    0
    Comment actions Permalink
  • Avatar
    Cesc

    Thank you Aliza

    I´ve also follow with your comment this link and has been helpful

    https://www.digitalocean.com/community/tutorials/how-to-protect-an-nginx-server-with-fail2ban-on-ubuntu-14-04

    and it seems work !

     

    2019-02-05 00:42:36,070 fail2ban.actions        [22701]: NOTICE  [nginx-noscript] Ban 143.255.155.141
    2019-02-05 00:42:36,071 fail2ban.filter [22701]: INFO [recidive] Found 143.255.155.141
    2019-02-05 00:42:46,512 fail2ban.filter [22701]: INFO [plesk-wordpress] Found 69.163.216.113
    2019-02-05 00:42:48,622 fail2ban.filter [22701]: INFO [plesk-wordpress] Found 69.163.216.113
    2019-02-05 00:42:49,285 fail2ban.actions [22701]: NOTICE [plesk-wordpress] Ban 69.163.216.113
    2019-02-05 00:42:49,289 fail2ban.filter [22701]: INFO [recidive] Found 69.163.216.113
    2019-02-05 00:44:25,948 fail2ban.filter [22701]: INFO [plesk-apache] Found 123.125.71.57
    2019-02-05 00:44:25,950 fail2ban.filter [22701]: INFO [plesk-apache] Found 123.125.71.57
    2019-02-05 00:44:26,539 fail2ban.actions [22701]: NOTICE [plesk-apache] Ban 123.125.71.57
    2019-02-05 00:44:26,543 fail2ban.filter [22701]: INFO [recidive] Found 123.125.71.57
    2019-02-05 00:46:05,143 fail2ban.filter [22701]: INFO [nginx-noscript] Found 66.220.149.3
    2019-02-05 00:46:05,504 fail2ban.actions [22701]: NOTICE [nginx-noscript] Ban 66.220.149.3
    2019-02-05 00:46:05,505 fail2ban.filter [22701]: INFO [recidive] Found 66.220.149.3
    2019-02-05 00:47:03,516 fail2ban.filter [22701]: INFO [plesk-apache] Found 148.251.179.108
    2019-02-05 00:51:44,650 fail2ban.filter [22701]: INFO [nginx-noscript] Found 142.93.103.151
    2019-02-05 00:51:45,080 fail2ban.actions [22701]: NOTICE [nginx-noscript] Ban 142.93.103.151
    2019-02-05 00:51:45,084 fail2ban.filter [22701]: INFO [recidive] Found 142.93.103.151 

    I took advantage to configure other jails !

     

    Thank you again!

     

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Cesc
    Glad to know that it helped! Thank you for the link as well, I think that it can be helpful for other Pleskians as well.

    0
    Comment actions Permalink
  • Avatar
    Khoneketa

    Good day. This has not helped me. Server down for over 2days now.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Khoneketa,

    Error 502 for websites may have a variety of causes, e.g. issues with PHP or Apache down.

    Try checking this article for guidance: https://support.plesk.com/hc/en-us/articles/115001463089--HUB-502-Bad-Gateway

     

    In case this wouldn't help, consider submitting a request for Plesk Support:

    https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support- 

    0
    Comment actions Permalink
  • Avatar
    Khoneketa

    Thank you for the response. I now get a 403 Forbidden

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    @Khoneketa, if the server has been down for 2 days please submit a request as described here: https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support- 

    0
    Comment actions Permalink
  • Avatar
    Khoneketa

    support tickets are refusing since we did not purchase license directly.

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh

    @Khoneketa,

    In this case you should either contact the partner from whom you bought the license or purchase support subscription to be able to contact Plesk Support Team directly. The subscription is free of charge during the 1st month.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request