0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-30 22:34:15 -05:00
caddy/caddytest/integration/caddyfile_adapt/php_fastcgi_matcher.txt
Matt Holt 3e1fd2a8d4
httpcaddyfile: Wrap site block in subroute if host matcher used (#5130)
* httpcaddyfile: Wrap site block in subroute if host matcher used (fix #5124)

* Correct boolean logic (oops)
2022-10-12 09:27:08 -06:00

2.8 KiB

:8884

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": { "http": { "servers": { "srv0": { "listen": [ ":8884" ], "routes": [ { "handle": [ { "handler": "subroute", "routes": [ { "handle": [ { "handler": "subroute", "routes": [ { "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" } ] } ], "match": [ { "path": [ ".php" ] } ] } ] } ], "match": [ { "host": [ "example.com" ] } ] } ] } ], "terminal": true } ] } } } } }