Answer the question
In order to leave comments, you need to log in
Handling requests to unserved sites?
The web server on the VDS is configured in such a way that when accessing the ip address, it displays the default site. The situation is as follows: we register the left domain, we prescribe the ip-address of our vds to it in the DNS. Now, if you type this left domain in the browser, we will see our default site. We begin to heavily promote this left domain in viral requests (porn, spam, penis enlargement, etc.) and voila! Some garbage is going on with the promotion of all sites on our VDS.
What to do with it?
Answer the question
In order to leave comments, you need to log in
Create a default server that simply closes the connection. In all other servers, write down the names by which they should open.
server {
listen 80 default_server;
return 404;
}
server {
listen 80;
server_name example.com www.example.com;
...
}
Something is not clear about the problem...
1. Set up the web server so that no site gives any site at all by ip address (if we are talking about this)
2. Write the host directive in robots.txt to indicate to the PS which domain is correct (if we are talking about aliases)
return 444 in nginx for everyone who came to the wrong host.
I do not prescribe in my default, for example, but in the config for each I keep a rule to check who they came to, it happened historically.
Well, or 418, so funnier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question