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 | :8080 |
| 2 | |
| 3 | # With explicit wildcard matcher |
| 4 | route { |
| 5 | root * /a |
| 6 | } |
| 7 | |
| 8 | # With path matcher |
| 9 | route { |
| 10 | root /path /b |
| 11 | } |
| 12 | |
| 13 | # With named matcher |
| 14 | route { |
| 15 | @named method GET |
| 16 | root @named /c |
| 17 | } |
| 18 | |
| 19 | # With no matcher, assumed to be wildcard |
| 20 | route { |
| 21 | root /d |
| 22 | } |
| 23 | ---------- |
| 24 | { |
| 25 | "apps": { |
| 26 | "http": { |
| 27 | "servers": { |
| 28 | "srv0": { |
| 29 | "listen": [ |
| 30 | ":8080" |
| 31 | ], |
| 32 | "routes": [ |
| 33 | { |
| 34 | "handle": [ |
| 35 | { |
| 36 | "handler": "subroute", |
| 37 | "routes": [ |
| 38 | { |
| 39 | "handle": [ |
| 40 | { |
| 41 | "handler": "vars", |
| 42 | "root": "/a" |
| 43 | } |
| 44 | ] |
| 45 | } |
| 46 | ] |
| 47 | }, |
| 48 | { |
| 49 | "handler": "subroute", |
| 50 | "routes": [ |
| 51 | { |
| 52 | "handle": [ |
| 53 | { |
| 54 | "handler": "vars", |
| 55 | "root": "/b" |
| 56 | } |
| 57 | ], |
| 58 | "match": [ |
| 59 | { |
| 60 | "path": [ |
| 61 | "/path" |
| 62 | ] |
| 63 | } |
| 64 | ] |
| 65 | } |
| 66 | ] |
| 67 | }, |
| 68 | { |
| 69 | "handler": "subroute", |
| 70 | "routes": [ |
| 71 | { |
| 72 | "handle": [ |
| 73 | { |
| 74 | "handler": "vars", |
| 75 | "root": "/c" |
| 76 | } |
| 77 | ], |
| 78 | "match": [ |
| 79 | { |
| 80 | "method": [ |
| 81 | "GET" |
| 82 | ] |
| 83 | } |
| 84 | ] |
| 85 | } |
| 86 | ] |
| 87 | }, |
| 88 | { |
| 89 | "handler": "subroute", |
| 90 | "routes": [ |
| 91 | { |
| 92 | "handle": [ |
| 93 | { |
| 94 | "handler": "vars", |
| 95 | "root": "/d" |
| 96 | } |
| 97 | ] |
| 98 | } |
| 99 | ] |
| 100 | } |
| 101 | ] |
| 102 | } |
| 103 | ] |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |