I have a domain name that I use with Nginx 1.13 and don't want to to have IP resolvable via browser. I was trying to do this in the /etc/nginx/conf.d/default.conf but was stilling getting 403 error message so then created another config file under sites-enabled with the following:
server {
listen 80 default_server;
server_name 0.0.0.0;
return 444;
}
(Replace 0.0.0.0 for privacy but my real IP in there on my end). It works fine now and doesn't return any pages for the IP address but am wondering if this is the best way. Is there another way that is better?
server {
listen 80 default_server;
server_name 0.0.0.0;
return 444;
}
(Replace 0.0.0.0 for privacy but my real IP in there on my end). It works fine now and doesn't return any pages for the IP address but am wondering if this is the best way. Is there another way that is better?