mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-23 13:14:08 +08:00
fastcgi: Preserve query during canonical redirect
This commit is contained in:
parent
2e6f626067
commit
68edb1acd1
@ -8,7 +8,7 @@ route {
|
||||
}
|
||||
not path */
|
||||
}
|
||||
redir @canonicalPath {http.request.orig_uri.path}/ 308
|
||||
redir @canonicalPath {http.request.orig_uri.path}/{http.request.uri.prefixed_query} 308
|
||||
|
||||
# If the requested file does not exist, try index files
|
||||
@indexFiles {
|
||||
@ -50,7 +50,7 @@ route {
|
||||
"handler": "static_response",
|
||||
"headers": {
|
||||
"Location": [
|
||||
"{http.request.orig_uri.path}/"
|
||||
"{http.request.orig_uri.path}/{http.request.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.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.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.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.uri.prefixed_query}"
|
||||
]
|
||||
},
|
||||
"status_code": 308
|
||||
|
@ -343,7 +343,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
|
||||
}
|
||||
redirHandler := caddyhttp.StaticResponse{
|
||||
StatusCode: caddyhttp.WeakString(strconv.Itoa(http.StatusPermanentRedirect)),
|
||||
Headers: http.Header{"Location": []string{"{http.request.orig_uri.path}/"}},
|
||||
Headers: http.Header{"Location": []string{"{http.request.orig_uri.path}/{http.request.uri.prefixed_query}"}},
|
||||
}
|
||||
redirRoute := caddyhttp.Route{
|
||||
MatcherSetsRaw: []caddy.ModuleMap{redirMatcherSet},
|
||||
|
Loading…
x
Reference in New Issue
Block a user