当我尝试将以下代码添加到 httpd.conf 文件尾部时遇到以下问题:
#iframe config
Header always append X-Frame-Options ALLOW-FROM http://xxxx
Syntax error on line 489 of C:/Program Files (x86)/Apache Software Foundation/Ap ache2.2/conf/httpd.conf: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
最佳答案
在加载命令下方添加/取消注释
LoadModule headers_module modules/mod_headers.so
将行更改为下面
#Header set X-Frame-Options "ALLOW-FROM http://xxxxxx" #Header set X-Frame-Options "DENY" Header set X-Frame-Options "SAMEORIGIN"
关于cross-domain - 在 Apache HTTP Server 2.2 中设置 X-FRAME-OPTIONS 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38237265/