mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
caddyhttp: Add {?query}
placeholder (#6714)
* caddyhttp: Add `{prefixed_query}` placeholder * fastcgi: Preserve query during canonical redirect * Use orig_uri instead for the redirect, shorter Caddyfile shortcut
This commit is contained in:
parent
16d5b22349
commit
b116dcea3d
8 changed files with 30 additions and 11 deletions
|
@ -8,7 +8,7 @@ route {
|
|||
}
|
||||
not path */
|
||||
}
|
||||
redir @canonicalPath {http.request.orig_uri.path}/ 308
|
||||
redir @canonicalPath {orig_path}/{orig_?query} 308
|
||||
|
||||
# If the requested file does not exist, try index files
|
||||
@indexFiles {
|
||||
|
@ -17,7 +17,7 @@ route {
|
|||
split_path .php
|
||||
}
|
||||
}
|
||||
rewrite @indexFiles {http.matchers.file.relative}
|
||||
rewrite @indexFiles {file_match.relative}
|
||||
|
||||
# Proxy PHP files to the FastCGI responder
|
||||
@phpFiles {
|
||||
|
@ -50,7 +50,7 @@ route {
|
|||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
|
|
@ -33,7 +33,7 @@ php_fastcgi @test localhost:9000
|
|||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
|
|
@ -43,7 +43,7 @@ php_fastcgi localhost:9000 {
|
|||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
|
|
@ -46,7 +46,7 @@ php_fastcgi localhost:9000 {
|
|||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.orig_uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue