Skip to content

Instantly share code, notes, and snippets.

@AysadKozanoglu
Created April 10, 2016 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AysadKozanoglu/b544d2b4514e87c3f33be26a3387481c to your computer and use it in GitHub Desktop.
Save AysadKozanoglu/b544d2b4514e87c3f33be26a3387481c 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