Created
September 28, 2023 09:18
-
-
Save audabas/b838ac3c8c818824e72dad190412ce7c to your computer and use it in GitHub Desktop.
Nginx block https on unregistred domains
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
| server { | |
| listen 443 ssl default_server; | |
| listen [::]:443 ssl default_server; | |
| # Disable logging | |
| error_log /dev/null; | |
| access_log off; | |
| # Snakeoil TLS to appease Nginx | |
| ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; | |
| ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; | |
| ssl_stapling off; | |
| ssl_ciphers NULL; | |
| # Close the connection without sending a response | |
| return 444; | |
| } | |
| # source : https://stackoverflow.com/a/75249412/7740841 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment