1. Caddy version (caddy version
):
Latest Caddy docker image
2. How I run Caddy:
Caddy in a docker environment; Latest version keeping up to date with watchtower.
a. System environment:
OS: Currently on Ubuntu 20.04 LTS
Docker: Version 19.03.8
b. Command:
docker start caddy
c. Service/unit/compose file:
docker run -d -p 83:80 -p 446:443 -v /XXXX:/data -v /XXXX:/etc/caddy/Caddyfile --restart=always --name caddy caddy
d. My complete Caddyfile or JSON config:
XXX.com {
reverse_proxy 192.168.1.161:81
}
XXX.XXX.com {
reverse_proxy 192.168.1.161:32400
}
XXX.XXX.com {
reverse_proxy 192.168.1.151:3579
}
XXX.XXX.com {
reverse_proxy 192.168.1.161:9980
}
XXX.XXX.com {
reverse_proxy 192.168.1.161:88
}
XXX.XXX.com {
reverse_proxy wordpress:8585
}
XXX.XXX.com {
redir / /XXX/ 308
reverse_proxy 192.168.1.161:8080 {
flush_interval -1
}
}
XXX.com {
redir / /XXX/ 308
reverse_proxy 192.168.1.161:8080 {
flush_interval -1
}
}
3. The problem I’m having:
I got Wordpress running in a docker. The site works well if I go to 192.168.1.161:8585. I want to use my Caddy V2 to do the reverse proxy however the config mentioned above doesn’t work.
4. Error messages and/or full log output:
When browsing to my subdomain i get “ERR_CONNECTION_TIMED_OUT”
5. What I already tried:
I attempted multiple alterations of my config on suggestions of what I found on internet; among those:
example.com
root * /var/www/wordpress
php_fastcgi unix//run/php/php-version-fpm.sock
file_server
mywebsite.domain.ext {
root * /var/www/html
reverse_proxy * localhost:2346 {
header_up Host {http.reverse_proxy.upstream.hostport}
header_up X-Forwarded-For {http.request.remote}
header_up X-Real-IP {http.reverse-proxy.upstream.address}
header_up X-Forwarded-Port {http.reverse_proxy.upstream.port}
header_up X-Forwarded-Proto {http.request.scheme}
}
}
dev.example.com {
proxy / wordpress {
transparent
}
}
XXX.XXX.com {
redir / /index.php/ 308
reverse_proxy 192.168.1.161:8585 {
flush_interval -1
}
}
The latest entry of my caddy docker log is this:
{"level":"info","ts":1601016137.9601762,"msg":"serving initial configuration"}
By now I pretty much used any variation of the configuration I could find online and in combinations driving me pretty nuts.
The thing I don’t really understand is the php_fastcgi either; do I need that or is it optional? I am looking to run a really low-demand amount of webpages and using Wordpress to ease the setup.
Are there things I need to change in the Wordpress settings?
Any help would be really appreciated! Thanks in advance!