Created
June 8, 2015 05:28
-
-
Save noodny/681521329d6ee25780e9 to your computer and use it in GitHub Desktop.
Disable default server in nginx
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
server { | |
listen 80 default_server; | |
server_name _; | |
deny all; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would add
return 444;
to the configuration (to prevent nginx from returning the 403 Response):The complete configuration would be:
That way the server closes the connection and it's as if there were no server at all. (The IPv6 part is just for completeness).