Answer the question
In order to leave comments, you need to log in
Why is there an endless redirect from https to http and vice versa?
Hello!
I installed the certificate using https://letsencrypt.org/.
But when entering the site, there is an endless redirection from http to https and vice versa, the error "The site stasenok.com redirected too many times." "ERR_TOO_MANY_REDIRECTS".
What could be the problem, I don’t understand the server settings well.
I am attaching a screenshot of my nginx domain config file:
And also the config connected to it:
Answer the question
In order to leave comments, you need to log in
That's why
if ($host = stasenok.com ) {
return 301 ....
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
http {
map "$server_port:$host" $is_https_redirect {
"~^80:(.+)" 1;
}
}
if ($is_https_redirect) {
return 301 https://$host$request_uri;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question