The default port varnish listening to is 6081, so when I visit the site 192.168.200.184:6081 I see the content served with varnish headers and everything works as expected using HTTP.
3. The problem I’m having:
I can not connect using Caddy proxy.
When trying to connect to https://viktorli.hopto.org I get:
The page isn’t redirecting properly
When trying to connect to http://viktorli.hopto.org I get:
I think the problem is with the reverse_proxy directive. I thought that the code from NGNIX could help.So I need to translate NGNIX configuration to Caddyfile and I do not really understand how to do it correctly.
The NGNIX config:
You don’t need to do anything special for the proxy in Caddy, because Caddy’s header handling will do what you need automatically:
reverse_proxy 127.0.0.1:8080
Please note that you should let Caddy bind on port 80 so that it can do ACME HTTP challenges, so you should run your app on a different port than what’s in your nginx config. Port 8080 is probably fine.
The default port for varnish is 6081, so when I visit the site 192.168.200.184:6081 I see the content served with varnish headers and everything works as expected using http.
So now my goal is to use Caddy to serve it from my domain name with SSL.
I tried what you suggested in two variations. When configuring proxy using https in Caddyfile:
Thank you. Sorry, it was a typo while copying. Edited the previous comment. Could it be that I should pass and recieve some headers back? Especially the: