summaryrefslogtreecommitdiff
path: root/caddytest
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/global_server_options_multi.txt8
-rw-r--r--caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt155
2 files changed, 87 insertions, 76 deletions
diff --git a/caddytest/integration/caddyfile_adapt/global_server_options_multi.txt b/caddytest/integration/caddyfile_adapt/global_server_options_multi.txt
index c01173b..ca5306f 100644
--- a/caddytest/integration/caddyfile_adapt/global_server_options_multi.txt
+++ b/caddytest/integration/caddyfile_adapt/global_server_options_multi.txt
@@ -3,9 +3,7 @@
timeouts {
idle 90s
}
- protocol {
- strict_sni_host insecure_off
- }
+ strict_sni_host insecure_off
}
servers :80 {
timeouts {
@@ -16,9 +14,7 @@
timeouts {
idle 30s
}
- protocol {
- strict_sni_host
- }
+ strict_sni_host
}
}
diff --git a/caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt b/caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt
index d90b2cb..e5b331e 100644
--- a/caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt
+++ b/caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt
@@ -1,7 +1,12 @@
:8884
-@api host example.com
-php_fastcgi @api localhost:9000
+# the use of a host matcher here should cause this
+# site block to be wrapped in a subroute, even though
+# the site block does not have a hostname; this is
+# to prevent auto-HTTPS from picking up on this host
+# matcher because it is not a key on the site block
+@test host example.com
+php_fastcgi @test localhost:9000
----------
{
"apps": {
@@ -13,13 +18,6 @@ php_fastcgi @api localhost:9000
],
"routes": [
{
- "match": [
- {
- "host": [
- "example.com"
- ]
- }
- ],
"handle": [
{
"handler": "subroute",
@@ -27,82 +25,99 @@ php_fastcgi @api localhost:9000
{
"handle": [
{
- "handler": "static_response",
- "headers": {
- "Location": [
- "{http.request.orig_uri.path}/"
- ]
- },
- "status_code": 308
- }
- ],
- "match": [
- {
- "file": {
- "try_files": [
- "{http.request.uri.path}/index.php"
- ]
- },
- "not": [
+ "handler": "subroute",
+ "routes": [
{
- "path": [
- "*/"
+ "handle": [
+ {
+ "handler": "static_response",
+ "headers": {
+ "Location": [
+ "{http.request.orig_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": "localhost:9000"
+ "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": "localhost:9000"
+ }
+ ]
+ }
+ ],
+ "match": [
+ {
+ "path": [
+ "*.php"
+ ]
+ }
+ ]
}
]
}
],
"match": [
{
- "path": [
- "*.php"
+ "host": [
+ "example.com"
]
}
]
}
]
}
- ]
+ ],
+ "terminal": true
}
]
}