I’m migrating a few web apps from a shared web server to a Digital Ocean droplet. Since I’m going to be hosting more than one application in the same machine I need a proxy that will direct traffic to the correct application based on the domain name.
I decided to use HAProxy because I have never used it and because in the future I can extend it to also do load balancing if necessary.
Since I’m moving a domain that I already own from one shared server to a Digital Ocean droplet, the process I’m going to follow is going to be something like this:
- Set up my application in the droplet so it runs in a port different to port 80
- Set up HAProxy so it runs on port 80 and routes all traffic coming from the correct domain name to my application
- Change DNS configuration so traffic from my application domain is now sent to the droplet