diff --git a/app/etc/di.xml b/app/etc/di.xml
index 934345e2462db..dfd08cb7b81cf 100644
--- a/app/etc/di.xml
+++ b/app/etc/di.xml
@@ -2033,4 +2033,12 @@
             <argument name="commandRenderer" xsi:type="object">Magento\Framework\Shell\CommandRendererBackground</argument>
         </arguments>
     </virtualType>
+
+    <type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
+        <arguments>
+            <argument name="alternativeHeaders" xsi:type="array">
+                <item name="x-forwarded-for" xsi:type="string">HTTP_X_FORWARDED_FOR</item>
+            </argument>
+        </arguments>
+    </type>
 </config>

