Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: 502 Bad Gateway - nginx

  1. #11
    sn00p's Avatar
    sn00p is offline Active Member
    Join Date
    Sep 2008
    Location
    Russia Federation, Novosibirsk
    Posts
    32
    Rep Power
    6

    Default

    Nope. Standart Zimbra installation with no hand-made changes to system logic except light postfix tuning.
    With best regards,

  2. #12
    erulabs is offline Intermediate Member
    Join Date
    Jun 2008
    Posts
    15
    Rep Power
    7

    Default

    Any updates on this? We had an issue with our Primary mailbox server (wasn't bringing apache up correctly), which lead to the '502 bad gateway' message from nginx (which makes perfectly good sense).

    However, I'm still seeing this from time to time... I'm not seeing anything in the nginx logs that is helpful (at least to me).

    Anyone got any ideas?
    Last edited by erulabs; 03-19-2009 at 09:06 AM. Reason: typo

  3. #13
    Matt is offline Active Member
    Join Date
    Sep 2006
    Posts
    32
    Rep Power
    8

    Default

    I've been experiencing a few issues with this too. Check the number of jetty connections isn't above zimbraHttpNumThreads.

    I've also restricted the nginx lookups to a single mailbox server by commenting out additional zmroutehandlers in conf/nginx/includes/nginx.conf.web. Afterwards you have to kill the nginx process and run it manually otherwise zimbra will recreate the nginx config files. Command to start nginx is (as zimbra user):

    sudo /opt/zimbra/nginx/sbin/nginx -c /opt/zimbra/conf/nginx.conf

    Reason I did this was because the logs were showing some bad lookups.

  4. #14
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Matt, if you make those sort of changes to the files in /opt/zimbra/conf/nginx/templates then they should be retained across ZCS restarts; but not upgrades.

  5. #15
    Matt is offline Active Member
    Join Date
    Sep 2006
    Posts
    32
    Rep Power
    8

    Default

    Thanks but its just a temporary change until I can diagnose the cause properly.

    One thing I've been meaning to test but haven't got around to yet... how well does the nginx route lookup handle one of the mailbox servers being down? The timeout value seems very high.
    Last edited by Matt; 04-02-2009 at 03:52 AM.

  6. #16
    Vladimir is offline Advanced Member
    Join Date
    Aug 2007
    Posts
    220
    Rep Power
    7

    Default

    We've been seeing a related issue, with nginx failing to find live upstreams. I have a case open with support and we have tried lots and lots of things but so far no real resolution. Lucky for us, it seems that our problem is mostly invisible to the users.

    There is something seriously wrong with the proxy layer I think, because our errors are completly random, happening in the middle of nite or middle of day, load or no load, with pleanty of threads.

  7. #17
    Matt is offline Active Member
    Join Date
    Sep 2006
    Posts
    32
    Rep Power
    8

    Default

    Any update on this Vladimir?

    We're still seeing bad gateway alerts but like you, very few actual user issues.

  8. #18
    Vladimir is offline Advanced Member
    Join Date
    Aug 2007
    Posts
    220
    Rep Power
    7

    Default

    Not really, still working with support on this, still no resultion. To be honest, we don't know if users aren't seeing thing as web clitches or whatever. We are just not getting any reports of users seeing it.

  9. #19
    Matt is offline Active Member
    Join Date
    Sep 2006
    Posts
    32
    Rep Power
    8

    Default

    Although we've had no complaints from users, our monitoring is fairly frequently picking up bad gateway errors and I have been able to see this error in my browser on the login page. It went away after a refresh.

  10. #20
    Matt is offline Active Member
    Join Date
    Sep 2006
    Posts
    32
    Rep Power
    8

    Default

    I've applied some changes to the nginx config files this morning which have made a big difference. It is too soon to say if this has fixed the problem completely.

    In nginx.conf.web add a keepalive_timeout value:

    http
    {
    # .Define the collection of upstream HTTP servers to which we will proxy
    # Define each serverort against a server directive
    #

    # Matts keepalive change
    keepalive_timeout 600;

    upstream zimbra


    In nginx.conf.web.http and https add timeout values:

    # Fudge inter-mailbox redirects (kludge)
    proxy_redirect http://$relhost/ http://$http_host/;

    # Matts increased timeout
    proxy_read_timeout 600;
    proxy_send_timeout 600;
    }
    }

    The nginx defaults are 60 seconds.

    With the above changes our monitoring has not picked up a single bad gateway request.

Page 2 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Proxy and error 502 question
    By markusvl in forum Installation
    Replies: 2
    Last Post: 09-23-2009, 08:11 AM
  2. proxy and 502 responses
    By sdouglass in forum Administrators
    Replies: 0
    Last Post: 01-07-2009, 03:00 PM
  3. mobile calender Internal Server Error
    By padraig in forum Administrators
    Replies: 19
    Last Post: 04-24-2008, 08:04 AM
  4. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  5. mta and mailbox die
    By Morg0 in forum Administrators
    Replies: 5
    Last Post: 03-20-2006, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •