Answer the question
In order to leave comments, you need to log in
How to deny access to the site if the visitor accesses the machine's direct IP?
how to disable access to the site by direct ip like http://1.1.1.1 in nginx?
Answer the question
In order to leave comments, you need to log in
NGINX will eventually answer yes. You can make a separate config that will catch "all other" ( default_server
) requests, incl. by direct IP:
server {
listen 80 default_server;
server_name _;
return 444;
}
Here _
, the underscore is not something magical, just a non-existent domain name. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question