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;
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.
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.