maz solie
maz solie's

maz solie's

Inlets Reverse Proxy with Caddy2

maz solie's photo
maz solie
·Aug 18, 2020·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

If you read my past article, maybe you didn't notice if I use version 1 of caddy. While it's okay and running fine, I found that caddy 1 actually will be ended at October 2020, so migrate to caddy 2 is urged. The problem, caddy 2 is not backward compatible, so very likely I'll take a lot of time configuring this and that. Luckily, my configuration is very simple. I just use caddy to serve inlets.

I actually setup a new GCP compute engine to try the caddy and inlets. So, here is the Caddyfile: {
root /var/www/html
proxy / {

proxy /tunnel {

With the new caddy 2, this is the adjustment I found to be working: {
  respond / "Hi stranger!"
} {
  reverse_proxy /tunnel {
    header_up Host {}
    header_up X-Real-IP {http.request.remote_host}
    header_up X-Forwarded-For {http.request.remote_host}
    header_up X-Forwarded-Port {http.request.port}
    header_up X-Forwarded-Proto {http.request.scheme}
  @websockets {
    header Connection *Upgrade*
    header Upgrade webscoket

My next experiment will be dynamic subdomain for inlets client, so it will be almost the same with ngrok and serveo capability, though I'm not sure, since my DNS provider doesn't allow the wildcard subdomain.

Share this