Skip to content

Instantly share code, notes, and snippets.

@simonlehmann
Last active July 20, 2017 07:45
Show Gist options
  • Save simonlehmann/c4b9c7708e00faa2fe4e398f80d71386 to your computer and use it in GitHub Desktop.
Save simonlehmann/c4b9c7708e00faa2fe4e398f80d71386 to your computer and use it in GitHub Desktop.
Global catch-all server block for Nginx
html {
[...]
##
# Virtual Host Configs
##
# Default catch-all server block
server {
listen *:80 default_server;
listen *:443 default_server;
server_name _;
ssl_certificate /etc/nginx/ssl/example.com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example.com/example.com.key;
return 404;
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment