Skip to content

Instantly share code, notes, and snippets.

@audabas
Created September 28, 2023 09:18
Show Gist options
  • Select an option

  • Save audabas/b838ac3c8c818824e72dad190412ce7c to your computer and use it in GitHub Desktop.

Select an option

Save audabas/b838ac3c8c818824e72dad190412ce7c to your computer and use it in GitHub Desktop.
Nginx block https on unregistred domains
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