summaryrefslogtreecommitdiff
path: root/caddytest/integration
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration')
-rw-r--r--caddytest/integration/caddyfile_adapt/file_server_status.txt112
1 files changed, 112 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/file_server_status.txt b/caddytest/integration/caddyfile_adapt/file_server_status.txt
new file mode 100644
index 0000000..ede1f4a
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/file_server_status.txt
@@ -0,0 +1,112 @@
+localhost
+
+root * /srv
+
+handle /nope* {
+ file_server {
+ status 403
+ }
+}
+
+handle /custom-status* {
+ file_server {
+ status {env.CUSTOM_STATUS}
+ }
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":443"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "host": [
+ "localhost"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "vars",
+ "root": "/srv"
+ }
+ ]
+ },
+ {
+ "group": "group2",
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "file_server",
+ "hide": [
+ "./Caddyfile"
+ ],
+ "status_code": "{env.CUSTOM_STATUS}"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "match": [
+ {
+ "path": [
+ "/custom-status*"
+ ]
+ }
+ ]
+ },
+ {
+ "group": "group2",
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "file_server",
+ "hide": [
+ "./Caddyfile"
+ ],
+ "status_code": 403
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "match": [
+ {
+ "path": [
+ "/nope*"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "terminal": true
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file