@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 113 lines 1.76 KB
Raw
1 whoami.example.com {
2 reverse_proxy whoami
3 }
4
5 app.example.com {
6 reverse_proxy app:80
7 }
8 unix.example.com {
9 reverse_proxy unix//path/to/socket
10 }
11 ----------
12 {
13 "apps": {
14 "http": {
15 "servers": {
16 "srv0": {
17 "listen": [
18 ":443"
19 ],
20 "routes": [
21 {
22 "match": [
23 {
24 "host": [
25 "whoami.example.com"
26 ]
27 }
28 ],
29 "handle": [
30 {
31 "handler": "subroute",
32 "routes": [
33 {
34 "handle": [
35 {
36 "handler": "reverse_proxy",
37 "upstreams": [
38 {
39 "dial": "whoami:80"
40 }
41 ]
42 }
43 ]
44 }
45 ]
46 }
47 ],
48 "terminal": true
49 },
50 {
51 "match": [
52 {
53 "host": [
54 "unix.example.com"
55 ]
56 }
57 ],
58 "handle": [
59 {
60 "handler": "subroute",
61 "routes": [
62 {
63 "handle": [
64 {
65 "handler": "reverse_proxy",
66 "upstreams": [
67 {
68 "dial": "unix//path/to/socket"
69 }
70 ]
71 }
72 ]
73 }
74 ]
75 }
76 ],
77 "terminal": true
78 },
79 {
80 "match": [
81 {
82 "host": [
83 "app.example.com"
84 ]
85 }
86 ],
87 "handle": [
88 {
89 "handler": "subroute",
90 "routes": [
91 {
92 "handle": [
93 {
94 "handler": "reverse_proxy",
95 "upstreams": [
96 {
97 "dial": "app:80"
98 }
99 ]
100 }
101 ]
102 }
103 ]
104 }
105 ],
106 "terminal": true
107 }
108 ]
109 }
110 }
111 }
112 }
113 }