Hey guyz!
Pls help
My config domain.comwww.domain.com{
bind 127.0.0.5
proxy / 127.0.0.20:80 {
transparent
}
}
This config i see Too many redirects in my browser
Your Caddyfile only issues one redirect - from HTTP to HTTPS. You have configured it to respond the same to the www subdomain exactly the same as the bare domain.
The redirects are coming from the upstream nginx server. The most common issue Caddy users face is when an upstream expects a HTTPS connection but they proxy to HTTP - the client (Caddy) gets told to use HTTPS, which gets passed to the client, who ends up in an infinite loop because they connected to HTTPS in the first place.
But that response isn’t consistent with a HTTPS redirect loop - in fact, it didn’t redirect at all. So the upstream server is possibly generating the redirect loop all by itself for real clients (via JS maybe? not sure). Nothing else in the Caddyfile you posted indicates an issue.
If you want to disable Caddy’s automatic HTTP->S redirection, you can override the HTTP listener. You need to specify that Caddy should respond to HTTP requests the same as it does for HTTPS.
In practice, this means splitting the list of site labels into their HTTP and HTTPS components.
I don’t think there’s any other advice I can give - there’s no other possible source of redirection. Perhaps someone else on these forums can spot something I’ve missed or has another idea to troubleshoot.
I changed backend port to 443
Redirect and loop magic disabled, also new trouble
Any https request via browser send me This messages
Client sent an HTTP request to an HTTPS server.