So I have a Master
caddy which redirects to another servers inside the LAN.
The current configuration of the Master
is like the following:
http://example.com {
proxy / http://192.168.1.153:80 {
transparent
}
}
https://example.com {
proxy / https://192.168.1.153:443 {
transparent
}
}
And the configuration of the caddy at 192.168.1.153
is the following:
http://example.com, https://example.com {
root /example.com
}
http://example.com works fine but https://example.con gives 502 Bad Gateway.
If i use insecure_skip_verify
I receive 403... And I don't want to use it anyway.
Both 80 and 443 are open on the router and redirecting to the Master caddy. There must be something wrong with my configuration but I cannot see what is it.
PD
I have tried:
192.168.1.153:443
None seem to work.
Updated with solution
http://example.com {
redir https://{host}{uri}
}
https://example.com {
proxy / 192.168.1.153:80 {
transparent
}
}
This also redirects 80 to 443, but the catch is that the "slave" on 192.168.1.153 must respond on port 80, not on 443. Because the 80 gets "upgraded" to 443 on the master caddy.