D
D
das342015-12-30 12:43:36
Nginx
das34, 2015-12-30 12:43:36

Why does nginx redirect from server ip address to domain name?

Good day everyone!!!
nginx began to redirect from the ip address of the server to one of the domains located on this server, did not make any changes, what could be the reason? and a similar situation was when Apache was on the server, then changed to nginx for about a month, everything worked, then a similar situation began.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Artyomov, 2015-12-30
@das34

If you access by IP, then nginx opens the default host or, if one is not specified explicitly, the first host in the list. Before you opened phpmyadmin. Perhaps he was first on the list. Most likely, some kind of host was added, which became higher than the previous one and something like

if ($host != 'site.ru' ) {
    rewrite			^/(.*)$  http://site.ru/$1  permanent;
  }

Set the phpmyadmin host explicitly to the default host: listen 80 default_server;

D
Dmitry, 2015-12-30
@ExileeD

Nginx redirects to the default domain. solution or create another address and set it as default. or create host with IP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question