Created
April 10, 2016 23:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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