My current server setup includes Apache and Ejabberd. Apache functions like a proxy to ejabberd demands.

Now I've incorporated another level where Nginx functions like a proxy image server before apache. So Nginx process all demands by defaults and forwards all php demands to apache.

Now i'm tied to the ejabberd polling because it now conveys with nginx first rather than apache, and so i keep obtaining a 502 Bad request.

Ho will i build a storage shed situation.

I tired this in nginx but it doesn't 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;

I wasn't the one which arrange it, however i have a similar type of setup presently running inside a production atmosphere. We make use of the same configurations while you published above, with the help of these three.

proxy_buffering off;
tcp_nodelay on;
keepalive_timeout 55;

I believe the tcp_nodelay may be the vital one because the connections are intended to be keep-alive.

If this doesn't repair it, please provide error logs from nginx.