Answer the question
In order to leave comments, you need to log in
Why does nginx redirect to localhost?
Hello! I registered a redirect from http to https in the nginx config.
server {
listen 443 ssl;
ssl_certificate /etc/ssl/mysite.ru.crt;
ssl_certificate_key /etc/ssl/mysite.ru.key;
server_name mysite.ru;
root /var/www/web/sites/$host/public;
index index.php index.html index.htm;
if ($ssl_protocol = "") {rewrite ^ https://$host$request_uri? permanent;}
}
Answer the question
In order to leave comments, you need to log in
The given server is for http s . And you need to look at the server that listen 80. Therefore, the redirect not given here works. We do:
grep -iR listen /etc/nginx | grep 80
and look at the found files.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question