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