My codeigniter application is running against a 502 bad gateway error. I know there are other threads on this subject, but I am no server wizard, the symptoms are different and my server config is slightly different as well, or so I think.
This is my situation.
- The application works fine, until I post a form for the nth time (n being anywhere between 2 and n times). This nth time is exactly the same as the earlier postings. I just change one field and then press the submit button.
- The form uses the validation class, and I customized the error message setter in such a way that these messages are also set as flashdata in the session (I want the messages to be available after a redirect).
- My server uses Nginx and apache (Plesk, apache service daemon is called httpd). If I do “service httpd stop” or “service nginx stop” all my websites stop working immediately.
- There are no errors in the error log.
My question is this: Could this be a coding issue, or is it most definately (or most likely) a misconfiguration of the server? If it is the latter, all advice is welcome of course, but remember it is a plesk/apache/nginx environment.
Hope you guys can help!
I would recommend checking Apache server status right after failure (
service httpd status). Not much details for better judgement, but one of likely scenarios would be that Apache fails on Nth request, so Nginx cannot forward request to Apache and returns “502 Bad Gateway” to you.The Apache failure may be both programmatic and misconfiguration issue. i.e. it takes too much RAM on Nth request (my understanding that you keep some date between requests) and then is killed by virtualization engine (in case you have VPS rather than dedicated hardware server). Just a hypothesis so far, but I have experienced cases like that before.