Last active
October 9, 2023 21:20
-
-
Save danishsatkut/970d6d71f4ab89276c807237125c001b to your computer and use it in GitHub Desktop.
NGINX - Doesn't allow a server to be accessed by ip
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; | |
listen [::]:80 default_server; | |
server_name ""; | |
return 444; | |
} |
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; | |
listen [::]:80 default_server; | |
listen 443 default_server; | |
listen [::]:443 default_server; | |
# Can be generated by: | |
# cd /etc/ssl | |
# openssl req -x509 -newkey rsa:2048 -days 10000 -nodes -subj '/CN=' -keyout null.key -out null.crt | |
ssl_certificate /etc/ssl/null.crt; | |
ssl_certificate_key /etc/ssl/null.key; | |
server_name ""; | |
return 444; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment