Created
December 5, 2015 05:52
-
-
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
This file contains hidden or 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