Answer the question
In order to leave comments, you need to log in
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
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;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question