Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 01:00 UTC
| 1 | subdomain.example.com { |
| 2 | respond "Subdomain!" |
| 3 | } |
| 4 | |
| 5 | *.example.com { |
| 6 | tls cert.pem key.pem |
| 7 | respond "Wildcard!" |
| 8 | } |
| 9 | ---------- |
| 10 | { |
| 11 | "apps": { |
| 12 | "http": { |
| 13 | "servers": { |
| 14 | "srv0": { |
| 15 | "listen": [ |
| 16 | ":443" |
| 17 | ], |
| 18 | "routes": [ |
| 19 | { |
| 20 | "match": [ |
| 21 | { |
| 22 | "host": [ |
| 23 | "subdomain.example.com" |
| 24 | ] |
| 25 | } |
| 26 | ], |
| 27 | "handle": [ |
| 28 | { |
| 29 | "handler": "subroute", |
| 30 | "routes": [ |
| 31 | { |
| 32 | "handle": [ |
| 33 | { |
| 34 | "body": "Subdomain!", |
| 35 | "handler": "static_response" |
| 36 | } |
| 37 | ] |
| 38 | } |
| 39 | ] |
| 40 | } |
| 41 | ], |
| 42 | "terminal": true |
| 43 | }, |
| 44 | { |
| 45 | "match": [ |
| 46 | { |
| 47 | "host": [ |
| 48 | "*.example.com" |
| 49 | ] |
| 50 | } |
| 51 | ], |
| 52 | "handle": [ |
| 53 | { |
| 54 | "handler": "subroute", |
| 55 | "routes": [ |
| 56 | { |
| 57 | "handle": [ |
| 58 | { |
| 59 | "body": "Wildcard!", |
| 60 | "handler": "static_response" |
| 61 | } |
| 62 | ] |
| 63 | } |
| 64 | ] |
| 65 | } |
| 66 | ], |
| 67 | "terminal": true |
| 68 | } |
| 69 | ], |
| 70 | "tls_connection_policies": [ |
| 71 | { |
| 72 | "match": { |
| 73 | "sni": [ |
| 74 | "*.example.com" |
| 75 | ] |
| 76 | }, |
| 77 | "certificate_selection": { |
| 78 | "any_tag": [ |
| 79 | "cert0" |
| 80 | ] |
| 81 | } |
| 82 | }, |
| 83 | {} |
| 84 | ] |
| 85 | } |
| 86 | } |
| 87 | }, |
| 88 | "tls": { |
| 89 | "certificates": { |
| 90 | "load_files": [ |
| 91 | { |
| 92 | "certificate": "cert.pem", |
| 93 | "key": "key.pem", |
| 94 | "tags": [ |
| 95 | "cert0" |
| 96 | ] |
| 97 | } |
| 98 | ] |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |