E
E
Eugene2014-07-11 18:55:53
linux
Eugene, 2014-07-11 18:55:53

Why is nginx displaying the wrong domain?

Good evening.
I have nginx and php-fpm on my server.
I started setting up nginx, wrote 2 configs, they look something like this:
aaa.conf

server {
   listen 80;
   server_name aaa.ru
   .....
}

bbb.conf
server {
   listen 80;
   server_name bbb.ru
   .....
}
server {
   listen 80;
   server_name domain.bbb.ru
   .....
}

So, when I open any non-existent domain on bbb.ru , for example, test.bbb.ru , the site aaa.ru is displayed for me ! How to prevent it? Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2014-07-11
@Qwofer

Finish aaa.

server {
   listen 80;
   server_name aaa.ru *.aaa.ru
   .....
}

Finish bbb
server {
   listen 80;
   server_name domain.bbb.ru
   .....
}


server {
   listen 80;
   server_name bbb.ru *.bbb.ru
   .....
}
}

And set the default server
server {
    listen   80 default_server;
    server_name example.net www.example.net;
    root  на_страницу приветствия или заглушку 
    ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question