In rare circumstances, you want to use a websites full domain (say https://mywebsite.com) while testing in dev mode. This can be useful if you need to test third party integrations like embeds, cookie banners, Google Tag Manger or other integrations that allowlist your actual domain.
To achieve this, we will have to
- make our system resolve
mywebsite.comtolocalhost, - run a reverse proxy on
localhost:443with a (locally signed and accepted) SSL certificate formywebsite.com, - forward the traffic to our actual dev server.
On linux, this can be achieved with these steps (instructions for Ubuntu):
Resolving mywebsite.com to 127.0.0.1
Add an entry to /etc/hosts of the form
127.0.0.1 mywebsite.com
Generate an SSL certificate with "mkcert"
- Install mkcert:
sudo apt install mkcert libnss3-tools - Install mkcert as a local certificate authority:
mkcert -install - Generate an SSL certificate for you domain:
mkcert mywebsite.com
Set up a reverse proxy using that certificate with "caddy"
- Install caddy
sudo apt install caddy - Disable the global caddy service
sudo systemctl stop caddy.service sudo systemctl disable caddy.service - Create a file named
Caddyfilemywebsite.com { tls ./name-of-the-generated-cert.pem ./name-of-the-generated-cert-key.pem reverse_proxy localhost:3000 } - Start caddy
(This requires
sudo caddy runsudobecause we want to bind to restricted port 443.)
Now you should be able to open your dev server by going to https://mywebsite.com. Don't forget to remove the change to /etc/hosts when you're done testing.
Posted by Tobias Kraze to makandra dev (2026-02-24 11:42)