You can use php or nginx to add the X-Frame-Options header to control frame permissions
X-Frame-Options has three optional values:
DENY: The browser refuses the current page to load any Frame page
SAMEORIGIN: The address of the frame page can only be the page under the same origin domain name
ALLOW-FROM: The page address that allows the frame to be loaded
PHP code:
Copy code The code is as follows:
header('X-Frame-Options:Deny');
Nginx configuration:
Copy code The code is as follows:
add_header X-Frame-Options SAMEORIGIN
can be added to the location
Copy code The code is as follows:
location /
{
add_header X-Frame -Options SAMEORIGIN
}
Apache configuration:
Copy code The code is as follows:
Header always append X-Frame-Options SAMEORIGIN
After using it, a whiteboard will be displayed on pages that do not allow frames.
Reference:
https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options?redirectlocale=en-US&redirectslug=The_X-FRAME-OPTIONS_response_header
http://www.bkjia.com/PHPjc/781033.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/781033.htmlTechArticleYou can use php or nginx to add X-Frame-Options header to control frame permissions. There are three X-Frame-Options Optional values: DENY: The browser refuses the current page to load any Frame page SAMEORI...