I am managing a php script which begins having a start id and limit, and calls themself every time using the next id with META HTTP-EQUIV="Refresh" until it reaches the limit. The reason behind the refresh would be to keep a record, to prevent timeout issues and merely to split the large task to more compact ones. Sometimes I recieve 502 Bad Gateway errors. I've now idea why. I have never witnessed the server return this kind of error on the other scripts.
What could possibly be the reason or/and just how can one debug the main reason?

Before examining this, make certain your browser includes a obvious cache.

Should you get the errors, you will find two common potential problems that may be happening:

1. Your firewall is functioning improperly.

This may be an problem if you work with a proxy, so that your computer isn't receiving back the protocol information that needs to be getting. Look at your proxy/DNS configurations.

2. Your Web service provider is getting a tool failure.

Clearly, very little that you can do relating to this. When the problem continues, and does not appear to become triggered by you, you might like to speak to your Web service provider.

(Also, read this helpful site explaining 502 Bad Gateway errors).