I am running a php webapp and consistently get a: 502 bad gateway nginx error when attempting certain function within the site. Without trying to go into detail about what specific code may cause this (cause it could be anything) has anyone ever experienced this with a php/apache setup? Is it a code issue or an admin issue? I am using webfaction as my host.
Update: here is a log of the responses from my host:
This is often a symptom of hitting the maximum concurrent requests on the shared apache instance. If you would like, we can set you up on a private Apache+PHP instance, which should solve this issue for you. It will also have the added advantage of a performance increase, and the slight disadvantage of being counted towards your memory usage.
If you find it is happening consistently on a single function, then the concurrent requests issue is not the problem. It is most likely a time-out of the function you have narrowed it down to.
Your options in this case, are to either optimise the code for this function so it responds in a more timely fashion, or you could look into the possibility of increasing the time-out limit during that script's execution.
Does it seem like they are making any sense with this? I don't know what he means by a function timing out since I developed the app locally on a lamp stack with no time-out problems. Only once I uploaded the application to webfaction did I start getting this error.