mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 20:24:11 +08:00
httpcaddyfile: Add {remote} shorthand placeholders
Also sort the list
This commit is contained in:
parent
490cd02f82
commit
c0f827e0bd
|
@ -94,15 +94,18 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
|
||||||
// their actual placeholder identifiers or
|
// their actual placeholder identifiers or
|
||||||
// variable names
|
// variable names
|
||||||
replacer := strings.NewReplacer(
|
replacer := strings.NewReplacer(
|
||||||
"{uri}", "{http.request.uri}",
|
"{dir}", "{http.request.uri.path.dir}",
|
||||||
"{path}", "{http.request.uri.path}",
|
"{file}", "{http.request.uri.path.file}",
|
||||||
"{host}", "{http.request.host}",
|
"{host}", "{http.request.host}",
|
||||||
"{hostport}", "{http.request.hostport}",
|
"{hostport}", "{http.request.hostport}",
|
||||||
"{method}", "{http.request.method}",
|
"{method}", "{http.request.method}",
|
||||||
"{scheme}", "{http.request.scheme}",
|
"{path}", "{http.request.uri.path}",
|
||||||
"{file}", "{http.request.uri.path.file}",
|
|
||||||
"{dir}", "{http.request.uri.path.dir}",
|
|
||||||
"{query}", "{http.request.uri.query}",
|
"{query}", "{http.request.uri.query}",
|
||||||
|
"{remote_host}", "{http.request.remote.host}",
|
||||||
|
"{remote_port}", "{http.request.remote.port}",
|
||||||
|
"{remote}", "{http.request.remote}",
|
||||||
|
"{scheme}", "{http.request.scheme}",
|
||||||
|
"{uri}", "{http.request.uri}",
|
||||||
)
|
)
|
||||||
for _, segment := range sb.block.Segments {
|
for _, segment := range sb.block.Segments {
|
||||||
for i := 0; i < len(segment); i++ {
|
for i := 0; i < len(segment); i++ {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user