Debian Codegraph @

caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.caddyfiletest

raw
1 :8884
2
3 # the use of a host matcher here should cause this
4 # site block to be wrapped in a subroute, even though
5 # the site block does not have a hostname; this is
6 # to prevent auto-HTTPS from picking up on this host
7 # matcher because it is not a key on the site block
8 @test host example.com
9 php_fastcgi @test localhost:9000
10 ----------
11 {
12 "apps": {
13 "http": {
14 "servers": {
15 "srv0": {
16 "listen": [
17 ":8884"
18 ],
19 "routes": [
20 {
21 "handle": [
22 {
23 "handler": "subroute",
24 "routes": [
25 {
26 "handle": [
27 {
28 "handler": "subroute",
29 "routes": [
30 {
31 "handle": [
32 {
33 "handler": "static_response",
34 "headers": {
35 "Location": [
36 "{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
37 ]
38 },
39 "status_code": 308
40 }
41 ],
42 "match": [
43 {
44 "file": {
45 "try_files": [
46 "{http.request.uri.path}/index.php"
47 ]
48 },
49 "not": [
50 {
51 "path": [
52 "*/"
53 ]
54 }
55 ]
56 }
57 ]
58 },
59 {
60 "handle": [
61 {
62 "handler": "rewrite",
63 "uri": "{http.matchers.file.relative}"
64 }
65 ],
66 "match": [
67 {
68 "file": {
69 "split_path": [
70 ".php"
71 ],
72 "try_files": [
73 "{http.request.uri.path}",
74 "{http.request.uri.path}/index.php",
75 "index.php"
76 ],
77 "try_policy": "first_exist_fallback"
78 }
79 }
80 ]
81 },
82 {
83 "handle": [
84 {
85 "handler": "reverse_proxy",
86 "transport": {
87 "protocol": "fastcgi",
88 "split_path": [
89 ".php"
90 ]
91 },
92 "upstreams": [
93 {
94 "dial": "localhost:9000"
95 }
96 ]
97 }
98 ],
99 "match": [
100 {
101 "path": [
102 "*.php"
103 ]
104 }
105 ]
106 }
107 ]
108 }
109 ],
110 "match": [
111 {
112 "host": [
113 "example.com"
114 ]
115 }
116 ]
117 }
118 ]
119 }
120 ],
121 "terminal": true
122 }
123 ]
124 }
125 }
126 }
127 }
128 }