Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Sucuri and 502 Bad Gateway for Dns issue?

Discussion in 'General Discussion' started by dexter009, Jun 3, 2017.

  1. dexter009

    dexter009 Registered

    Joined:
    Jun 3, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Rome
    cPanel Access Level:
    Root Administrator
    Hi guys,

    I have a strange problem, on a working domain and hosting we changed the dns setting pointing it to the sucuri waf ip and from that moment we are getting 502 bad gateway from nginx.

    I think the problem is related to the nginx dns query that return a different ip respect the cpanel one (the sucuri ip), could be?

    Any experience on it or what fix it?

    Thank you
    Regards
    Marco
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    720
    Likes Received:
    123
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Marco,

    Is the 502 bad gateway being thrown by Sucuri, or are you saying you have Nginx installed on your server?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dexter009

    dexter009 Registered

    Joined:
    Jun 3, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Rome
    cPanel Access Level:
    Root Administrator
    Hi,

    Yes, the error was coming out from my server that is running a classical setup nginx+apache.

    After many hours looking on google i have found the reason of this, the resolver option under the nginx configuration was performing a dns query to each domain before to pass the request to apache trying to connect to the sucuriIP:8080 that's the reason of the 502 error.

    The workaround has been to replace the google dns 8.8.8.8 used with the local bind server.

    Probably there is a better way to do this, but it's working fine.

    Thank you
    M.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm happy to see you were able to address the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice