Local HTTPS proxy with Caddy

Here’s how I set up an HTTPS proxy in front of a local service using a self-signed certificate and three lines of Caddy configuration.

I thought this would be a giant hassle, but Caddy made it easy.

The /etc/hosts entry:

127.0.0.1       whatever.local

The OpenSSL command:

openssl req  \
  -nodes -new -x509  \
  -keyout whatever.local.key \
  -out whatever.local.cert

The Caddyfile:

https://whatever.local {
  tls ./whatever.local.cert ./whatever.local.key
}

The Caddy command:

caddy run
 
Respond to this post via e-mail