Sign up for Amazon Lightsail account. Amazon Lightsail offers cost-effective virtual servers. You can set up virtual server for custom domain which will proxy traffic to your
Once logged into Amazon Lightsail, click
Create Instance button.
Select your instance location which should be the where you
.manager.io site is hosted. If you don’t know where your site is hosted, go to https://cloud.manager.io and click
Speed Test button to see where your data is hosted.
OS Only, then
Ubuntu 20.04 LTS
Select the cheapest price option for your region.
Create Instance button.
Create static IP button.
Attach to an instance section, select your server.
This will reveal your
Public static IP address. Use this IP address to create
A record for your custom domain so it points to your public static IP address you just created. This is something you will need to do in DNS settings for your domain.
After your DNS is configured. You should verify that your custom domain points to your static IP address (e.g. using
Networking tab for your instance, make sure
HTTPS protocol is added to your firewall rules. By default
HTTPS is not added.
Go back to details of your instance and click
Connect using SSH
This will open terminal window. Copy and paste the following commands.
This will download Caddy 2.2.0:
This will extract the archive you just downloaded:
tar xvzf caddy_2.2.0_linux_amd64.tar.gz
This will move
caddy binary to your
sudo mv caddy /usr/local/bin/
This command will launch
caddy as reverse proxy. Make sure to replace example domains for your actual domain names.
accounting.example.comfor your actual custom domain name for which you set up
A recordin previous steps.
example.manager.iofor your actual
caddy reverse-proxy --from accounting.example.com --to example.manager.io:443 --change-host-header
After launching the the command, test in web-browser to access your custom domain. If it’s working, install the systemd service unit configuration file. Again, don’t forget to replace
example.manager.io for your actual domain names.
printf "[Unit]\nAfter=network.target\n\n[Service]\nLimitNOFILE=1048576\nExecStart=/usr/local/bin/caddy reverse-proxy --from accounting.example.com --to example.manager.io:443 --change-host-header\nRestart=always\nStartLimitInterval=600\n\n[Install]\nWantedBy=multi-user.target" | sudo tee /etc/systemd/system/caddy.service
Then start Caddy.
sudo systemctl start caddy
Also have the Caddy Server service start automatically on boot so you don’t have to start it manually.
sudo systemctl enable caddy
Verify your custom domain is still working.