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