Is there way I can replicate a 502 gateway timeout error?

Viewed 3074

I am trying to create a page that will take more than 600 seconds to load. Do you have any idea on what to create for this to happen? Or just anything to generate the 502 gateway timeout error.

2 Answers

This must be done server-side. Depending on the backend language you are using, you have the following options:

  1. Return a 502 HTTP response (this can also be done directly in Apache or NGINX)
  2. Simulate a long response with a "sleep" function (this depends on what backend you are using)
  3. Infinite loop for testing purposes, but I couldn't recommend that!
Related