Hello, everyone.
I want to catch all invalid server name (empty AND undefined server name) to prevent invalid access.
But I confuse whether my configuration is exactly right.
I read two documents.
1. http://nginx.org/en/docs/http/server_names.html#miscellaneous_names
2. http://nginx.org/en/docs/http/request_processing.html#how_to_prevent_undefined_server_names
I thought that 'default_server' catches undefined server name, 'server_name _' doesn't have meaning and 'server_name ""' catches empty server name, but it can be omitted because of default setting.
So I wrote a configuration:
server {
listen 80 default_server;
return 444;
}
Is this configuration right? Thanks.
I want to catch all invalid server name (empty AND undefined server name) to prevent invalid access.
But I confuse whether my configuration is exactly right.
I read two documents.
1. http://nginx.org/en/docs/http/server_names.html#miscellaneous_names
2. http://nginx.org/en/docs/http/request_processing.html#how_to_prevent_undefined_server_names
I thought that 'default_server' catches undefined server name, 'server_name _' doesn't have meaning and 'server_name ""' catches empty server name, but it can be omitted because of default setting.
So I wrote a configuration:
server {
listen 80 default_server;
return 444;
}
Is this configuration right? Thanks.