Skip to content

Commit f4ff3bc

Browse files
dnaultbrett19
authored andcommitted
Motivation
---------- Proxy invalid Analytics URLs verbatim instead of "fixing" them. Modifications ------------- Disable `merge_slashes`. Remove trailing slash from `proxy_pass` so nginx doesn't recalculate the path and lose empty path components.
1 parent cae0f6c commit f4ff3bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

deployment/dockerdeploy/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ func (c *Controller) UpdateNginxConfig(ctx context.Context, containerID string,
752752
nginxConf += "}\n"
753753

754754
nginxConf += "server {\n"
755+
nginxConf += " merge_slashes off;\n" // Proxy invalid requests verbatim
755756
if withSsl {
756757
nginxConf += fmt.Sprintf(" listen %d ssl;\n", listenPort)
757758
nginxConf += " ssl_certificate /etc/nginx/ssl/cert.pem;\n"
@@ -765,7 +766,7 @@ func (c *Controller) UpdateNginxConfig(ctx context.Context, containerID string,
765766
if withSsl {
766767
protocol = "https"
767768
}
768-
nginxConf += fmt.Sprintf(" proxy_pass %s://%s/;\n", protocol, upstreamName)
769+
nginxConf += fmt.Sprintf(" proxy_pass %s://%s;\n", protocol, upstreamName)
769770
nginxConf += " proxy_set_header Host $http_host;\n"
770771
nginxConf += " proxy_set_header X-Real-IP $remote_addr;\n"
771772
nginxConf += " proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n"

0 commit comments

Comments
 (0)