summaryrefslogtreecommitdiff
path: root/caddytest/integration
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration')
-rw-r--r--caddytest/integration/caddyfile_adapt/php_fastcgi_expanded_form.txt132
1 files changed, 132 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/php_fastcgi_expanded_form.txt b/caddytest/integration/caddyfile_adapt/php_fastcgi_expanded_form.txt
new file mode 100644
index 0000000..d453128
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/php_fastcgi_expanded_form.txt
@@ -0,0 +1,132 @@
+:8886
+
+route {
+ # Add trailing slash for directory requests
+ @canonicalPath {
+ file {
+ try_files {path}/index.php
+ }
+ not path */
+ }
+ redir @canonicalPath {path}/ 308
+
+ # If the requested file does not exist, try index files
+ @indexFiles {
+ file {
+ try_files {path} {path}/index.php index.php
+ split_path .php
+ }
+ }
+ rewrite @indexFiles {http.matchers.file.relative}
+
+ # Proxy PHP files to the FastCGI responder
+ @phpFiles {
+ path *.php
+ }
+ reverse_proxy @phpFiles 127.0.0.1:9000 {
+ transport fastcgi {
+ split .php
+ }
+ }
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":8886"
+ ],
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "static_response",
+ "headers": {
+ "Location": [
+ "{http.request.uri.path}/"
+ ]
+ },
+ "status_code": 308
+ }
+ ],
+ "match": [
+ {
+ "file": {
+ "try_files": [
+ "{http.request.uri.path}/index.php"
+ ]
+ },
+ "not": [
+ {
+ "path": [
+ "*/"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "handle": [
+ {
+ "handler": "rewrite",
+ "uri": "{http.matchers.file.relative}"
+ }
+ ],
+ "match": [
+ {
+ "file": {
+ "split_path": [
+ ".php"
+ ],
+ "try_files": [
+ "{http.request.uri.path}",
+ "{http.request.uri.path}/index.php",
+ "index.php"
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "handle": [
+ {
+ "handler": "reverse_proxy",
+ "transport": {
+ "protocol": "fastcgi",
+ "split_path": [
+ ".php"
+ ]
+ },
+ "upstreams": [
+ {
+ "dial": "127.0.0.1:9000"
+ }
+ ]
+ }
+ ],
+ "match": [
+ {
+ "path": [
+ "*.php"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file