Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save muhafazakar/510ba9cbc6a7bd8fadce to your computer and use it in GitHub Desktop.

Select an option

Save muhafazakar/510ba9cbc6a7bd8fadce to your computer and use it in GitHub Desktop.
Nginx block unwanted open proxy, allow only POST, GET HEAD methods, No iframe embed - istenmedik acik proxy yi bloke et ve sadece POST GET HEAD methodlarine izin ver Iframe yerlestirmeyi yasakla
http{
...
#hide server version
server_tokens off;
# config to don't allow the browser to render the page inside an frame or iframe
add_header X-Frame-Options SAMEORIGIN;
server {
listen 80;
server_name localhost;
return 444;
break;
location / {
# in every server block that contain location paste this
if ($request_method !~ ^(GET|HEAD|POST)$ ){
return 444;
}
}
}
...
include "/usr/localvirtual/*.conf"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment