Just wondering—if I add this to the NGINX file, would it solve the problem? Maybe something to include in the config file by default?
http block in NGINX config:
map $http_host $bad_host {
"" 1;
default 0;
}
In the server block:
server {
listen 80;
server_name example.com;
if ($bad_host) {
return 400 "Missing Host header";
}
location / {
proxy_pass http://localhost:3000;
}
}
Would this work, or would I need to change anything? Any tips would be a great help.