Debian Codegraph @

caddytest/integration/caddyfile_adapt/php_fastcgi_subdirectives.caddyfiletest

raw
1 :8884
2
3 php_fastcgi localhost:9000 {
4 # some php_fastcgi-specific subdirectives
5 split .php .php5
6 env VAR1 value1
7 env VAR2 value2
8 root /var/www
9 index index.php5
10
11 # passed through to reverse_proxy (directive order doesn't matter!)
12 lb_policy random
13 }
14 ----------
15 {
16 "apps": {
17 "http": {
18 "servers": {
19 "srv0": {
20 "listen": [
21 ":8884"
22 ],
23 "routes": [
24 {
25 "match": [
26 {
27 "file": {
28 "try_files": [
29 "{http.request.uri.path}/index.php5"
30 ]
31 },
32 "not": [
33 {
34 "path": [
35 "*/"
36 ]
37 }
38 ]
39 }
40 ],
41 "handle": [
42 {
43 "handler": "static_response",
44 "headers": {
45 "Location": [
46 "{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
47 ]
48 },
49 "status_code": 308
50 }
51 ]
52 },
53 {
54 "match": [
55 {
56 "file": {
57 "try_files": [
58 "{http.request.uri.path}",
59 "{http.request.uri.path}/index.php5",
60 "index.php5"
61 ],
62 "try_policy": "first_exist_fallback",
63 "split_path": [
64 ".php",
65 ".php5"
66 ]
67 }
68 }
69 ],
70 "handle": [
71 {
72 "handler": "rewrite",
73 "uri": "{http.matchers.file.relative}"
74 }
75 ]
76 },
77 {
78 "match": [
79 {
80 "path": [
81 "*.php",
82 "*.php5"
83 ]
84 }
85 ],
86 "handle": [
87 {
88 "handler": "reverse_proxy",
89 "load_balancing": {
90 "selection_policy": {
91 "policy": "random"
92 }
93 },
94 "transport": {
95 "env": {
96 "VAR1": "value1",
97 "VAR2": "value2"
98 },
99 "protocol": "fastcgi",
100 "root": "/var/www",
101 "split_path": [
102 ".php",
103 ".php5"
104 ]
105 },
106 "upstreams": [
107 {
108 "dial": "localhost:9000"
109 }
110 ]
111 }
112 ]
113 }
114 ]
115 }
116 }
117 }
118 }
119 }