Greetings community!
I have configured a domain in my DO instance, all very well, the problem lies in being able to access the site using the IP of the Server and I really do not want that, I wish that only the site can be accessed through the domain, what type of configuration requires NGINX? or if it is not NGINX, where can I make this configuration?
Beforehand thank you very much.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
You can add this server block to your configuration.
server {
listen 80 default_server;
server_name "";
return 444;
}
You need to specify “default_server” parameter so that all non available server requests goes to this server block which throws 444 error. The “default_server” parameter cannot be present in any other server block.
444 : CONNECTION CLOSED WITHOUT RESPONSE
Click below to sign up and get $100 of credit to try our products over 60 days!
What about if using SSL? Thanks.