Reputation: 1243
I have a reverse proxy set up in nginx for a node.js server.
server {
listen 80;
server_name sub.domain.tld;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
It works all fine and dandy, however, I only want sub.domain.tld
to work. Opening up domain.tld
in a browser still routes to the node.js server.
Upvotes: 3
Views: 4965
Reputation: 457
try to add this
server {
listen 80;
server_name domain.tld;
return 404;
}
Upvotes: 6