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 | *.example.com { |
| 2 | log { |
| 3 | hostnames foo.example.com bar.example.com |
| 4 | output file /foo-bar.txt |
| 5 | } |
| 6 | log { |
| 7 | hostnames baz.example.com |
| 8 | output file /baz.txt |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | example.com:8443 { |
| 13 | log { |
| 14 | output file /port.txt |
| 15 | } |
| 16 | } |
| 17 | ---------- |
| 18 | { |
| 19 | "logging": { |
| 20 | "logs": { |
| 21 | "default": { |
| 22 | "exclude": [ |
| 23 | "http.log.access.log0", |
| 24 | "http.log.access.log1", |
| 25 | "http.log.access.log2" |
| 26 | ] |
| 27 | }, |
| 28 | "log0": { |
| 29 | "writer": { |
| 30 | "filename": "/foo-bar.txt", |
| 31 | "output": "file" |
| 32 | }, |
| 33 | "include": [ |
| 34 | "http.log.access.log0" |
| 35 | ] |
| 36 | }, |
| 37 | "log1": { |
| 38 | "writer": { |
| 39 | "filename": "/baz.txt", |
| 40 | "output": "file" |
| 41 | }, |
| 42 | "include": [ |
| 43 | "http.log.access.log1" |
| 44 | ] |
| 45 | }, |
| 46 | "log2": { |
| 47 | "writer": { |
| 48 | "filename": "/port.txt", |
| 49 | "output": "file" |
| 50 | }, |
| 51 | "include": [ |
| 52 | "http.log.access.log2" |
| 53 | ] |
| 54 | } |
| 55 | } |
| 56 | }, |
| 57 | "apps": { |
| 58 | "http": { |
| 59 | "servers": { |
| 60 | "srv0": { |
| 61 | "listen": [ |
| 62 | ":443" |
| 63 | ], |
| 64 | "routes": [ |
| 65 | { |
| 66 | "match": [ |
| 67 | { |
| 68 | "host": [ |
| 69 | "*.example.com" |
| 70 | ] |
| 71 | } |
| 72 | ], |
| 73 | "terminal": true |
| 74 | } |
| 75 | ], |
| 76 | "logs": { |
| 77 | "logger_names": { |
| 78 | "bar.example.com": [ |
| 79 | "log0" |
| 80 | ], |
| 81 | "baz.example.com": [ |
| 82 | "log1" |
| 83 | ], |
| 84 | "foo.example.com": [ |
| 85 | "log0" |
| 86 | ] |
| 87 | } |
| 88 | } |
| 89 | }, |
| 90 | "srv1": { |
| 91 | "listen": [ |
| 92 | ":8443" |
| 93 | ], |
| 94 | "routes": [ |
| 95 | { |
| 96 | "match": [ |
| 97 | { |
| 98 | "host": [ |
| 99 | "example.com" |
| 100 | ] |
| 101 | } |
| 102 | ], |
| 103 | "terminal": true |
| 104 | } |
| 105 | ], |
| 106 | "logs": { |
| 107 | "logger_names": { |
| 108 | "example.com": [ |
| 109 | "log2" |
| 110 | ] |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | } |