Maintenance mode not working in HTTPS

by niceonelee   Last Updated July 12, 2019 05:09 AM

I'm using 2.3 and nginx. When i enable maintenance mode and already add my IP in maintenance after, can not use HTTPS browse to my website. But i can use HTTP browse.

How can i fix this issue?

I already added this code but just can browse by HTTP.

Magento\Framework\HTTP\PhpEnvironment\RemoteAddress

use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress;

class MyClass { /** * @var RemoteAddress */ private $remoteAddress;

public function __construct(RemoteAddress $remoteAddress)
{
    $this->remoteAddress = $remoteAddress;
}

public function doSomething()
{
    $ipAddressOfTheClient = $this->remoteAddress->getRemoteAddress();
} }

app/etc/myproject/di.xml

<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>

Thank you!



Related Questions


Updated November 20, 2017 12:09 PM

Updated May 15, 2017 14:09 PM

Updated September 21, 2017 13:09 PM

Updated October 29, 2018 03:09 AM

Updated September 20, 2018 06:09 AM