Skip to content

Commit 593d55e

Browse files
committed
fix conversion of "$http_" nginx variables to Caddy placeholders
1 parent dbe70a5 commit 593d55e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nginxadapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func getCaddyVar(nginxVar string) string {
170170
// variables prefixed with `$http_` correspond to respective header field with the suffix name
171171
// Source: https://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_
172172
if strings.HasPrefix(nginxVar, "$http_") {
173-
return fmt.Sprintf("{http.request.header.%s}", strings.TrimPrefix(nginxVar, "$header_"))
173+
return fmt.Sprintf("{http.request.header.%s}", strings.TrimPrefix(nginxVar, "$http_"))
174174
}
175175
return fmt.Sprintf("{http.vars.%s}", strings.TrimPrefix(nginxVar, "$"))
176176
}

0 commit comments

Comments
 (0)