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 | # (this Caddyfile is contrived, but based on issues #4176 and #4198) |
| 2 | |
| 3 | http://example.com { |
| 4 | } |
| 5 | |
| 6 | https://example.com { |
| 7 | tls abc@example.com |
| 8 | } |
| 9 | |
| 10 | http://localhost:8081 { |
| 11 | } |
| 12 | |
| 13 | ---------- |
| 14 | { |
| 15 | "apps": { |
| 16 | "http": { |
| 17 | "servers": { |
| 18 | "srv0": { |
| 19 | "listen": [ |
| 20 | ":443" |
| 21 | ], |
| 22 | "routes": [ |
| 23 | { |
| 24 | "match": [ |
| 25 | { |
| 26 | "host": [ |
| 27 | "example.com" |
| 28 | ] |
| 29 | } |
| 30 | ], |
| 31 | "terminal": true |
| 32 | } |
| 33 | ] |
| 34 | }, |
| 35 | "srv1": { |
| 36 | "listen": [ |
| 37 | ":80" |
| 38 | ], |
| 39 | "routes": [ |
| 40 | { |
| 41 | "match": [ |
| 42 | { |
| 43 | "host": [ |
| 44 | "example.com" |
| 45 | ] |
| 46 | } |
| 47 | ], |
| 48 | "terminal": true |
| 49 | } |
| 50 | ] |
| 51 | }, |
| 52 | "srv2": { |
| 53 | "listen": [ |
| 54 | ":8081" |
| 55 | ], |
| 56 | "routes": [ |
| 57 | { |
| 58 | "match": [ |
| 59 | { |
| 60 | "host": [ |
| 61 | "localhost" |
| 62 | ] |
| 63 | } |
| 64 | ], |
| 65 | "terminal": true |
| 66 | } |
| 67 | ], |
| 68 | "automatic_https": { |
| 69 | "skip": [ |
| 70 | "localhost" |
| 71 | ] |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | }, |
| 76 | "tls": { |
| 77 | "automation": { |
| 78 | "policies": [ |
| 79 | { |
| 80 | "subjects": [ |
| 81 | "example.com" |
| 82 | ], |
| 83 | "issuers": [ |
| 84 | { |
| 85 | "email": "abc@example.com", |
| 86 | "module": "acme" |
| 87 | }, |
| 88 | { |
| 89 | "ca": "https://acme.zerossl.com/v2/DV90", |
| 90 | "email": "abc@example.com", |
| 91 | "module": "acme" |
| 92 | } |
| 93 | ] |
| 94 | } |
| 95 | ] |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | } |