N
N
Nikolai Savelyev2015-08-05 11:50:12
Nginx
Nikolai Savelyev, 2015-08-05 11:50:12

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

3 answer(s)
L
Lynn "Coffee Man", 2015-08-05
@nikweter

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;
  ...
}

UPD: As Vlad advises below, it's better to give 404 so that the bots fall behind faster. But the principle is still the same, you can give anything, for example, a redirect to the site of pests :)

A
Anton B, 2015-08-05
@bigton

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)

E
Ergil Osin, 2015-08-05
@Ernillew

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 question

Ask a Question

731 491 924 answers to any question