-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Caddyfile for on-demand TLS demo
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |