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 | # Identical policies for "a.example.com, b.example.com" and "*.api.example.com" |
| 2 | # must not be merged: the wildcard would move before the policy for |
| 3 | # "foo.api.example.com" and match that name first. force_automate makes |
| 4 | # foo.api.example.com get its own certificate instead of using the wildcard's. |
| 5 | a.example.com, b.example.com { |
| 6 | tls { |
| 7 | issuer acme |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | foo.api.example.com { |
| 12 | tls force_automate { |
| 13 | issuer internal |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | *.api.example.com { |
| 18 | tls { |
| 19 | issuer acme |
| 20 | } |
| 21 | } |
| 22 | ---------- |
| 23 | { |
| 24 | "apps": { |
| 25 | "http": { |
| 26 | "servers": { |
| 27 | "srv0": { |
| 28 | "listen": [ |
| 29 | ":443" |
| 30 | ], |
| 31 | "routes": [ |
| 32 | { |
| 33 | "match": [ |
| 34 | { |
| 35 | "host": [ |
| 36 | "foo.api.example.com" |
| 37 | ] |
| 38 | } |
| 39 | ], |
| 40 | "terminal": true |
| 41 | }, |
| 42 | { |
| 43 | "match": [ |
| 44 | { |
| 45 | "host": [ |
| 46 | "a.example.com", |
| 47 | "b.example.com" |
| 48 | ] |
| 49 | } |
| 50 | ], |
| 51 | "terminal": true |
| 52 | }, |
| 53 | { |
| 54 | "match": [ |
| 55 | { |
| 56 | "host": [ |
| 57 | "*.api.example.com" |
| 58 | ] |
| 59 | } |
| 60 | ], |
| 61 | "terminal": true |
| 62 | } |
| 63 | ], |
| 64 | "tls_connection_policies": [ |
| 65 | { |
| 66 | "match": { |
| 67 | "sni": [ |
| 68 | "foo.api.example.com" |
| 69 | ] |
| 70 | } |
| 71 | }, |
| 72 | {} |
| 73 | ] |
| 74 | } |
| 75 | } |
| 76 | }, |
| 77 | "tls": { |
| 78 | "certificates": { |
| 79 | "automate": [ |
| 80 | "foo.api.example.com" |
| 81 | ] |
| 82 | }, |
| 83 | "automation": { |
| 84 | "policies": [ |
| 85 | { |
| 86 | "subjects": [ |
| 87 | "a.example.com", |
| 88 | "b.example.com" |
| 89 | ], |
| 90 | "issuers": [ |
| 91 | { |
| 92 | "module": "acme" |
| 93 | } |
| 94 | ] |
| 95 | }, |
| 96 | { |
| 97 | "subjects": [ |
| 98 | "foo.api.example.com" |
| 99 | ], |
| 100 | "issuers": [ |
| 101 | { |
| 102 | "module": "internal" |
| 103 | } |
| 104 | ] |
| 105 | }, |
| 106 | { |
| 107 | "subjects": [ |
| 108 | "*.api.example.com" |
| 109 | ], |
| 110 | "issuers": [ |
| 111 | { |
| 112 | "module": "acme" |
| 113 | } |
| 114 | ] |
| 115 | } |
| 116 | ] |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | } |