Websites show 502 Bad Gateway after enabling nginx on a server with Fail2ban

Follow

Comments

11 comments

  • Avatar
    Olosz Andor

    This solution is worked for me (Plesk 17.0.17)

    Thank you! :)

  • Avatar
    iamkingsleyf

    did not help

  • 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

  • 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
  • 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.

  • Avatar
    Parahoster / Thibaut Robert

    Bonjour,

    j'ai cette erreur
    Réorientation / bin / systemctl redémarrer iptables.service
    Job pour iptables.service a échoué parce que le processus de commande est sorti avec le code d'erreur. Voir « état systemctl iptables.service » et « journalctl -xe » pour plus de détails.

    I don't understand

  • 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

  • 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

  • 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-

  • 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!

     

  • 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.

Please sign in to leave a comment.

Have more questions? Submit a request