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