@marcel91200 / caddy Mirror · read-only
Fork 0

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

master
caddyfiletest 154 lines 2.17 KB
Raw
1 &(first) {
2 @first path /first
3 vars @first first 1
4 respond "first"
5 }
6
7 &(second) {
8 respond "second"
9 }
10
11 :8881 {
12 invoke first
13 route {
14 invoke second
15 }
16 }
17
18 :8882 {
19 handle {
20 invoke second
21 }
22 }
23
24 :8883 {
25 respond "no invoke"
26 }
27 ----------
28 {
29 "apps": {
30 "http": {
31 "servers": {
32 "srv0": {
33 "listen": [
34 ":8881"
35 ],
36 "routes": [
37 {
38 "handle": [
39 {
40 "handler": "invoke",
41 "name": "first"
42 },
43 {
44 "handler": "subroute",
45 "routes": [
46 {
47 "handle": [
48 {
49 "handler": "invoke",
50 "name": "second"
51 }
52 ]
53 }
54 ]
55 }
56 ]
57 }
58 ],
59 "named_routes": {
60 "first": {
61 "handle": [
62 {
63 "handler": "subroute",
64 "routes": [
65 {
66 "handle": [
67 {
68 "first": 1,
69 "handler": "vars"
70 }
71 ],
72 "match": [
73 {
74 "path": [
75 "/first"
76 ]
77 }
78 ]
79 },
80 {
81 "handle": [
82 {
83 "body": "first",
84 "handler": "static_response"
85 }
86 ]
87 }
88 ]
89 }
90 ]
91 },
92 "second": {
93 "handle": [
94 {
95 "body": "second",
96 "handler": "static_response"
97 }
98 ]
99 }
100 }
101 },
102 "srv1": {
103 "listen": [
104 ":8882"
105 ],
106 "routes": [
107 {
108 "handle": [
109 {
110 "handler": "subroute",
111 "routes": [
112 {
113 "handle": [
114 {
115 "handler": "invoke",
116 "name": "second"
117 }
118 ]
119 }
120 ]
121 }
122 ]
123 }
124 ],
125 "named_routes": {
126 "second": {
127 "handle": [
128 {
129 "body": "second",
130 "handler": "static_response"
131 }
132 ]
133 }
134 }
135 },
136 "srv2": {
137 "listen": [
138 ":8883"
139 ],
140 "routes": [
141 {
142 "handle": [
143 {
144 "body": "no invoke",
145 "handler": "static_response"
146 }
147 ]
148 }
149 ]
150 }
151 }
152 }
153 }
154 }