Skip to content

Commit

Permalink
Add Caddyfile for on-demand TLS demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Feb 1, 2024
1 parent c93cc10 commit 4985d10
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions demo/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
debug
order psl first
order replace after encode
on_demand_tls {
ask http://localhost:8012
}
}

:443 {
tls {
on_demand
}
log

@notDemoResource not path /on-demand-tls /resources/*
rewrite @notDemoResource /on-demand-tls

reverse_proxy 10.138.88.42:80 {
header_up Accept-Encoding identity
header_up Host {upstream_hostport}
}

replace stream {
` src="/` ` src="https://caddyserver.com/`
` href="/` ` href="https://caddyserver.com/`
}
}

:8012 {
bind 127.0.0.1 ::1
psl
#@allowed `{query.domain} == "caddydemo."+{qs.domain.registered_domain}`
@allowed query domain=caddydemo.{qs.domain.public_registered_domain}
respond @allowed 200
respond 400
}
5 changes: 5 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This folder contains the Caddy config for the On-Demand TLS demo on the Caddy website.

It is hosted on a separate machine from the Caddy website so we can isolate canary builds in a production environment when necessary.

This config requires the [caddy-psl](https://github.com/mholt/caddy-psl) and [replace-response](https://github.com/caddyserver/replace-response) plugins.

0 comments on commit 4985d10

Please sign in to comment.