D
D
digitaldemiurge2013-02-06 12:26:46
Nginx
digitaldemiurge, 2013-02-06 12:26:46

Nginx and foreign domains

Hello!

There is the following problem: some comrades put their domains on our ip address and, accordingly, when visiting their site, our site is shown.

How can I configure nginx so that domains not specified in the configs are not processed by it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
allnightlong, 2013-02-06
@digitaldemiurge

I set mine up like this:

server {
server_name_;
return 444;
}

444 is an nginx internal code that terminates the connection immediately without returning anything

V
Vlad Zhivotnev, 2013-02-06
@inkvizitor68sl

server {
listen something there default;
return 404;
or (if you want to leave the traffic)
rewrite ^/(.*) where you need to go/ $1 permanent;
}

D
Dmitry Simba, 2013-02-06
@c4simba

you can specify the site (directory) by default. one of the servers in the config - specify the ip without specifying the domain
nginx.org/en/docs/http/request_processing.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question