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 example.manager.io
subdomain.
Once logged into Amazon Lightsail, click Create Instance
button.
Select 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.
Select Linux/Unit
platform.
Select OS Only
, then Ubuntu 20.04 LTS
Select the cheapest price option for your region.
Then click Create Instance
button.
Go to Networking
tab.
Then click Create static IP
button.
In Attach to an instance
section, select your server.
Then click Create
button.
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 ping
command).
Then under 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:
wget https://github.com/caddyserver/caddy/releases/download/v2.2.0/caddy_2.2.0_linux_amd64.tar.gz
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 bin
folder.
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.com
for your actual custom domain name for which you set up A record
in previous steps.example.manager.io
for your actual .manager.io
subdomain.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 accounting.example.com
and 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.
Done.
Subscribe to our newsletter and get exclusive product updates you won't find anywhere else straight to your inbox.