I want to setup Caddyserver to Rancher and already got it running, but I can’t proxy a domain to my WordPress Container.
I get “Connection refused” when I try to curl the domain. I forwarded the port 80 and 443 to Caddy, so this can’t be the problem.
I also tried to ping the internal DNS of the WordPress Container and I get the response from both sides.
I also tried to curl localhost on the WordPress container and I get response (well its just did not find the database or something like that, but this does not matter now)
The weird thing is also that Caddyserver gives no logs? I entered the stuff on the Caddyfile, but no logs?
I cant curl from Caddy container, because there is no curl in the Caddy package.
Weird thing is that it dont create logfiles, which means it dont get requests? I have looked at traffic in rancher in the Caddy container and it gets a peak when I request the URL.
I will try to serve a static file directly from Caddy later this day, because I am currently in the office.
I changed the Caddy package to abiosoft where I have curl. I can curl the WordPress container and get same response as curling localhost on the WordPress container.
I also tried to serve a markdown, but still having that connection refused.
I have no clue whats going on.
Thank you!
Changes:
I have tried another thing and got forward I think… now I get this in the log “docker logs containerid”:
2016/12/22 19:43:00 [INFO][squashfolio.de] Server responded with a certificate.
2016/12/22 19:43:00 [WARNING] Stapling OCSP: no OCSP stapling for [squashfolio.de]: ocsp: error from server: unauthorized
done.
https://www.squashfolio.de
https://squashfolio.de
http://www.squashfolio.de
http://squashfolio.de
2016/12/22 19:43:03 [INFO] SIGTERM: Terminating process
Activating privacy features...2016/12/22 19:43:06 [WARNING] Stapling OCSP: no OCSP stapling for [squashfolio.de]: ocsp: error from server: unauthorized
done.
http://www.squashfolio.de
http://squashfolio.de
https://www.squashfolio.de
https://squashfolio.de
To me, it sounds like requests aren’t reaching Caddy properly, which could be an issue with your configuration of Rancher, or perhaps your firewall.
If you can exec into your Caddy container, you could try something like installing Python and running python -m SimpleHTTPServer 80 to see if you can get a response from http://www.domain.com. If you still get Connection Refused, that way you know it’s not a Caddy issue.
Just saw your edit. Caddy’s log looks good. It even looks like it fetched a certificate, so it seems like LetsEncrypt was able to access it fine?
What do you get if you change your Caddyfile to something simple like :80 { browse } and navigate there via IP address?
as I already mentioned I got Caddyserver running. The Database is working correctly now and moved the domain to point to my new server. Somehow I get just a clear Website, even when I curl the webseite I get zero response.
I have made a look into the Caddyserver logs and WordPress logs and I get the request, but no response. I also installed nginx as a container and served the nginx to Caddy to see if Caddy is proxying correctly. I get the welcome screen from nginx. So this is working fine, but when I again bind the WordPress container to Caddy its just nothing.
Do you have a clue what can be the reason to get no response on the client but requests on the server?
Not sure I’m afraid. Looks like Caddy’s doing its job properly and so is the Docker network driver, which points to the issue lying with your WordPress container. Can you set up a fresh, unmodified WordPress container to proxy to from Caddy and see if you get something out of that?