mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
fileserver: Add pass_thru
Caddyfile option (#4613)
This commit is contained in:
parent
be82cc7aca
commit
09ba9e994e
2 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
|||
:80
|
||||
|
||||
file_server {
|
||||
pass_thru
|
||||
}
|
||||
----------
|
||||
{
|
||||
"apps": {
|
||||
"http": {
|
||||
"servers": {
|
||||
"srv0": {
|
||||
"listen": [
|
||||
":80"
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"handle": [
|
||||
{
|
||||
"handler": "file_server",
|
||||
"hide": [
|
||||
"./Caddyfile"
|
||||
],
|
||||
"pass_thru": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -120,6 +120,12 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
|
|||
falseBool := false
|
||||
fsrv.CanonicalURIs = &falseBool
|
||||
|
||||
case "pass_thru":
|
||||
if h.NextArg() {
|
||||
return nil, h.ArgErr()
|
||||
}
|
||||
fsrv.PassThru = true
|
||||
|
||||
default:
|
||||
return nil, h.Errf("unknown subdirective '%s'", h.Val())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue