I maintain a web application at work hosted on a cloud platform.
I was hoping to use this kind of workflow.
- While the live site is running, prepare a new environment identical to the production environment, just with new code running on it.
- Test for a while and if it's found to be good, switch production over to the new server, but keep the old one around.
- If the client encounters a problem, the idea is to quickly switch back to the original servers.
- If the new servers are good, eventually delete the old ones, and start the process over next time we deploy.
There are multiple server instances involved, configured in complicated ways, but they are all front-ended by an application/webserver. So switching would only involve pointing to a new front end server.
What would be the best way to achieve this?
I was thinking of using HAProxy, but all the examples are about failover or load balancing, I just really want to use it as a manual 'switch' to quickly switch between servers.
I'd also like for the proxy to do SSL termination and it has to deal with websockets.
nginx
and now I useCaddyserver
which makes easy to switch to HTTP/2 and use Let's Encrypt for SSL.