Skip to content

Instantly share code, notes, and snippets.

@Semdevmaster
Created November 17, 2021 14:45
Show Gist options
  • Select an option

  • Save Semdevmaster/ed88f1c7c66c1dd66224717071bb291a to your computer and use it in GitHub Desktop.

Select an option

Save Semdevmaster/ed88f1c7c66c1dd66224717071bb291a to your computer and use it in GitHub Desktop.
location / {
set $frame_options '';
if ($http_referer !~ '^https?:\/\/([^\/]+\.)?(yourdomain\.com|webvisor\.com|metri[ck]a\.yandex\.(com|ru|com\.tr))\/'){
set $frame_options 'SAMEORIGIN';
}
add_header X-Frame-Options $frame_options;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment