Jump to content

502 Bad Gateway


Recommended Posts

Posted

Hi Guys,

Has anyone ran into this error before when using nginx as a reverse proxy for apache? If so, what causes the problem and how would you fix it?

  • 2 weeks later...
Posted

if using as reverse proxy to apache check ports (unless using sockets) and, just to test, remove htaccess.

have had an issue where a rewrite rule caused issues.

this cpanel using nginx admin? if so may need to rebuild vhosts and restart nginx after too.

Posted

Hello,

For reference, how do you increase buffer and time outs?

Increase buffer and timeouts inside http block, this is located in your nginx.conf file (if you have any plugins for cpanel, look at those first for these settings), the following is what I have mine set to:

http {
...
fastcgi_buffers 8 16k; 
fastcgi_buffer_size 32k;  <--- increase - was 16k
fastcgi_connect_timeout 300; <--- increase - was 120
fastcgi_send_timeout 300; <--- increase - was 30
fastcgi_read_timeout 300; <--- increase - was 30
...
}

Hope that helps.

Posted

do the nginx admin plugin and the cpnginx cpanel plugins use those settings?

I cannot remember now but I don't remember seeing them in the conf file.

seems to me, with nginx admin plugin, it was a worker process issue (the ONE time I saw this) or apache issue.

thought I had noted it down somewhere but cannot find it now.

Posted

do the nginx admin plugin and the cpnginx cpanel plugins use those settings?

I cannot remember now but I don't remember seeing them in the conf file.

seems to me, with nginx admin plugin, it was a worker process issue (the ONE time I saw this) or apache issue.

thought I had noted it down somewhere but cannot find it now.

I know that nginx admin under configuration editor has the http block (see attached image - I know it is an old image but I can upload a newer version of it - if requested), have not used anything else.

I am sure all others have a config file somewhere where you are able to edit the http block.

10335636363_6122887c4d_o.png' alt='' cla" alt="10335636363_6122887c4d_o.png">

EDIT: Yes cpnginx has (some of) these settings that can be edited:

10335514165_b425aef352_o.png

Posted

cpxstack will need the domain php-fpm conf files edited for this also, this I know for sure. Most likely its a dynamic/static/on demand issue, at least that was my experience.

You may need to swap from sockets to tcp, on one domain (not ip setup) it was only way I could get reliability.

cpxstack is not acting as reverse proxy like the nginx admin or cpnginx plugins do really, for the selected domains its replacing apache and taking it out of the loop unless you select use php-fpm and stay apache..

I know that nginx admin under configuration editor has the http block (see attached image - I know it is an old image but I can upload a newer version of it - if requested), have not used anything else.

I am sure all others have a config file somewhere where you are able to edit the http block.

10335636363_6122887c4d_o.png' alt='' cla" alt="10335636363_6122887c4d_o.png">

EDIT: Yes cpnginx has (some of) these settings that can be edited:

10335514165_b425aef352_o.png

I knew there was http block, what I meant was the fastcgi lines as its not using php-fpm like cpxstack is. sorry I should have clarified the question better.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...