just to add up, I obviously tried to compare $http_host and it doesn't work:
server {
listen 80;
location / {
return 444; # drop connection silently
}
location /data/ {
if ($http_host != "") {
return 444;
}
alias /home/http/;
try_files $uri $uri.html =404;
}
}
server {
listen 80;
server_name example.com;
location /data/ {
alias /home/http/;
try_files $uri $uri.html =404;
}
}
server {
listen 80;
location / {
return 444; # drop connection silently
}
location /data/ {
if ($http_host != "") {
return 444;
}
alias /home/http/;
try_files $uri $uri.html =404;
}
}
server {
listen 80;
server_name example.com;
location /data/ {
alias /home/http/;
try_files $uri $uri.html =404;
}
}