Skip to content

Commit

Permalink
Fix Proxy web server middleware order
Browse files Browse the repository at this point in the history
The limiter middleware was being executed prior to the middleware
responsible updating the client IP from X-Forwarded-For headers.
This results in erroneously enforcing connection limits in NAT
environments.
  • Loading branch information
rosstimothy committed Jan 22, 2025
1 parent aebfaf7 commit a944f46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4984,8 +4984,8 @@ func (process *TeleportProcess) initProxyEndpoint(conn *Connector) error {
Server: &http.Server{
Handler: utils.ChainHTTPMiddlewares(
webHandler,
makeXForwardedForMiddleware(cfg),
limiter.MakeMiddleware(proxyLimiter),
makeXForwardedForMiddleware(cfg),
httplib.MakeTracingMiddleware(teleport.ComponentProxy),
),
// Note: read/write timeouts *should not* be set here because it
Expand Down

0 comments on commit a944f46

Please sign in to comment.