server-configs-nginx/conf.d/no-ssl.default.conf

28 lines
932 B
Nginx Configuration File
Raw Normal View History

# ----------------------------------------------------------------------
# | Default behavior for unknown hosts |
# ----------------------------------------------------------------------
#
2020-12-29 19:20:35 +01:00
# Drop requests for unknown hosts.
#
2019-05-14 19:02:21 +02:00
# If no default server is defined, Nginx will use the first found server.
# To prevent host header attacks, or other potential problems when an unknown
# server name is used in a request, it's recommended to drop the request
# returning 444 "No Response".
#
# (1) In production, only secure hosts should be used (all `no-ssl` disabled).
# If so, redirect first ANY request to a secure connection before handling
# it, even if the host is unknown.
#
# https://observatory.mozilla.org/faq/
server {
listen [::]:80 default_server deferred;
listen 80 default_server deferred;
server_name _;
# (1)
# return 301 https://$host$request_uri;
return 444;
}