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 | localhost:80 |
| 2 | |
| 3 | respond * "{header.content-type} {labels.0} {query.p} {path.0} {re.name.0}" |
| 4 | |
| 5 | @match path_regexp ^/foo(.*)$ |
| 6 | respond @match "{re.1}" |
| 7 | ---------- |
| 8 | { |
| 9 | "apps": { |
| 10 | "http": { |
| 11 | "servers": { |
| 12 | "srv0": { |
| 13 | "listen": [ |
| 14 | ":80" |
| 15 | ], |
| 16 | "routes": [ |
| 17 | { |
| 18 | "match": [ |
| 19 | { |
| 20 | "host": [ |
| 21 | "localhost" |
| 22 | ] |
| 23 | } |
| 24 | ], |
| 25 | "handle": [ |
| 26 | { |
| 27 | "handler": "subroute", |
| 28 | "routes": [ |
| 29 | { |
| 30 | "handle": [ |
| 31 | { |
| 32 | "body": "{http.regexp.1}", |
| 33 | "handler": "static_response" |
| 34 | } |
| 35 | ], |
| 36 | "match": [ |
| 37 | { |
| 38 | "path_regexp": { |
| 39 | "name": "match", |
| 40 | "pattern": "^/foo(.*)$" |
| 41 | } |
| 42 | } |
| 43 | ] |
| 44 | }, |
| 45 | { |
| 46 | "handle": [ |
| 47 | { |
| 48 | "body": "{http.request.header.content-type} {http.request.host.labels.0} {http.request.uri.query.p} {http.request.uri.path.0} {http.regexp.name.0}", |
| 49 | "handler": "static_response" |
| 50 | } |
| 51 | ] |
| 52 | } |
| 53 | ] |
| 54 | } |
| 55 | ], |
| 56 | "terminal": true |
| 57 | } |
| 58 | ] |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | } |