Skip to main content
added reference to other answer stating that it isn't possible using nginx directives alone
Source Link

AAs stated in another answer, there is no built-in way to make nginx do this. A possible solution is to use a load-balancing setup consisting of your current server, and a backup server that does the following for all requests:

  • poll your current server until it's back online
  • then respond with a 302 or other redirect so the browser tries again

This server would be marked with the 'backup' flag so that it's only tried when all other servers are offline (HTTP Load Balancing > Server Weights).

A possible solution is to use a load-balancing setup consisting of your current server, and a backup server that does the following for all requests:

  • poll your current server until it's back online
  • then respond with a 302 or other redirect so the browser tries again

This server would be marked with the 'backup' flag so that it's only tried when all other servers are offline (HTTP Load Balancing > Server Weights).

As stated in another answer, there is no built-in way to make nginx do this. A possible solution is to use a load-balancing setup consisting of your current server, and a backup server that does the following for all requests:

  • poll your current server until it's back online
  • then respond with a 302 or other redirect so the browser tries again

This server would be marked with the 'backup' flag so that it's only tried when all other servers are offline (HTTP Load Balancing > Server Weights).

Source Link

A possible solution is to use a load-balancing setup consisting of your current server, and a backup server that does the following for all requests:

  • poll your current server until it's back online
  • then respond with a 302 or other redirect so the browser tries again

This server would be marked with the 'backup' flag so that it's only tried when all other servers are offline (HTTP Load Balancing > Server Weights).