Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Properly handle HTTP requests without "Host: " header

$
0
0
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;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>