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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    599
    Likes Received:
    92
    Trophy Points:
    153
    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?
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see you were able to address the issue. Thank you for updating us with the outcome.
     
Loading...

Share This Page