0

My current server setup consists of Apache and Ejabberd. Apache acts as a proxy to ejabberd requests.

Now I have included another level where Nginx acts as a proxy image server in front of apache. So Nginx process all requests by defaults and forwards all php requests to apache.

Now I am stuck with the ejabberd polling as it now communicates with nginx first instead of apache, so I keep getting a 502 Bad request.

Ho do I go about this situation.

I tired this in nginx but it does not work

proxy_set_header Host $http_host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_pass http://localhost:5280;
user160108
  • 930
  • 3
  • 8
  • 38

1 Answers1

1

I wasn't the one that set it up, but I have the same kind of setup currently running in a production environment. We use the same settings as you posted above, with the addition of these three.

proxy_buffering off;
tcp_nodelay on;
keepalive_timeout 55;

I think that the tcp_nodelay is the vital one as the connections are meant to be keep-alive.

If this does not fix it, please provide error logs from nginx.

Lowe Thiderman
  • 498
  • 4
  • 7
  • i keep getting loads of these errors in my logs "upstream sent too big header while reading response header from upstream" – user160108 Oct 19 '11 at 18:51
  • [This question](http://stackoverflow.com/questions/2307231/how-to-avoid-nginx-upstream-sent-too-big-header-errors) suggests three different solutions to the problem. They all relate to setting higher buffer sizes. – Lowe Thiderman Oct 20 '11 at 07:00