From 4e02c7dc2c4ec744d2d075b4c0bdfca45373dc61 Mon Sep 17 00:00:00 2001
From: CSDUMMI <31551856+CSDUMMI@users.noreply.github.com>
Date: Tue, 14 Mar 2023 14:47:57 +0100
Subject: [PATCH]  Support the PROXY protocol through the PROXY_PROTO_V1 env
 variable (#24064)

---
 config/puma.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/config/puma.rb b/config/puma.rb
index e59295445..c4e2b0b85 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -22,3 +22,5 @@ on_worker_boot do
 end
 
 plugin :tmp_restart
+
+set_remote_address(proxy_protocol: :v1) if ENV['PROXY_PROTO_V1'] == 'true'