#Apache 設定 Header always append X-Frame-Options SAMEORIGIN #HTML META <meta http-equiv="X-Frame-Options" content="deny"> <meta http-equiv="X-Frame-Options" content="SAMEORIGIN"> <meta http-equiv="X-Frame-Options" content="ALLOW-FROM https://myhost"> #Nginx 設定 location /{ add_header X-Frame-Options SAMEORIGIN } #IIS <system.webServer> ... < httpProtocol > < customHeaders > < add name = " X-Frame-Options " value = " SAMEORIGIN " /> </ customHeaders > </ httpProtocol > ... </system.webServer> #HAProxy rspadd X-Frame-Options:\ SAMEORIGIN #PHP 方式 header('X-Frame-Options:Deny'); header('X-Frame-Options:SAMEORIGIN'); header('X-Frame-Options:ALLOW-FROM https://myhost ') if($_server['http_host']!='localhost'){exit('iframe is spammed');} ...