Magento – Magento 2 – Allow frontend run in frame

configurationmagento2system-configuration

I can't find the option to enable this confiuguration on Magento 2:

allow magento frontend to run in frame

on magento 1 was in system > configuration > admin > security

This old post shows how to do on magento 1: old post

Best Answer

Open the env.php file and put

'x-frame-options' => 'SAMEORIGIN',

Magento wants this in env.php because they claim that it’s more secure than setting a value in the Magento Admin.

Possible values for x-frame-options are three

DENY It prevents your site page from being included in an iFrame.

SAMEORIGIN If a parent page is from the same domain as your site page, the site page can be included in the iFrame.

ALLOW-FROM You can specify a single URI that is allowed to frame your site page e.g. ALLOW-FROM http://www.somedomain.com/

Add asterisk If you add an asterisk 'x-frame-options' => '*' it will allow all domains to access your Magento URL in the iframe. NOT RECOMMENDED BUT WORKING

Related Topic