I am seeing a lot of 502 and 504 errors

If you are receiving a lot of 502 or 504 errors this troubleshooting guide contains a few common tips to understand and resolve them. The HTTP code 502 indicates a "Bad Gateway" response and indicates that our server received an invalid response from your origin server. The 504 code indicates a "Gateway Timeout", that means that our server did not receive a successful response from your origin server in a set amount of time. This is what is usually causing the errors:

Your server is offline

The most likely cause for 502 errors is that your origin server is offline and our servers are not able to connect to it. In this case, our edge servers will always attempt to serve the files from our cache, but if they are not there 

Your server firewall is blocking our edge servers

Because our servers act as a proxy to all your users, this means that when you first start serving traffic, there will be a lot of requests going from our edge nodes to your servers. This might cause certain Firewall or security software to accidentally mistake these connections as a threat and block them.

To work around this problem, you can use our edge server IP list to whitelist all the connections coming from our network. The list is available at https://api.bunny.net/system/edgeserverlist and https://api.bunny.net/system/edgeserverlist/IPv6. To keep everything working, also make sure to periodically update your configuration to reflect any changes on our network.

Network congestion

The internet works on a limited set of paths that the connection can take and if something goes wrong somewhere down the line and our edge server is far away from your server, it might happen that the network might get congested and 502 and 504 errors get returned as a result of the network breaking down somewhere down the line. This is an unlikely situation, but it can happen in rare cases.

Our servers are experiencing problems

We monitor our network both automatically and manually 24/7, so this is a very unlikely situation, but of course, it can also happen that our servers are experiencing problems as well. If you are certain that the points above do not apply to you and that this problem lies on our side, send us a support ticket and we will investigate the situation immediately - our Super Bunnies are ready to assist 24/7. 

Table of Contents

Was this article helpful?
14 out of 27 found this helpful