- I am trying to configure caddy to proxy to another container on the same network (Running a play framework app). Here are the configs I have tried.
docker-compose.yml:
version: '3.7'
services:
play-demo:
container_name: play-demo
hostname: play-demo
restart: unless-stopped
image: openjdk:8-jre
volumes:
- /var/www/play-demo/artifacts/server-0.1.0-SNAPSHOT:/var/www/demo.***.com
networks:
- play
working_dir: /var/www/demo.***.com
expose:
- 9443
- 9000
command: /var/www/demo.***.com/bin/server -Dhttps.port=9443 -Dplay.crypto.secret='***'
caddy:
container_name: caddy
hostname: caddy
restart: unless-stopped
image: abiosoft/caddy:1.0.0
depends_on:
- play-demo
volumes:
- /var/www/play-demo/caddy/Caddyfile:/etc/Caddyfile
- /var/www/play-demo/artifacts/caddy/.caddy:/root/.caddy
- /var/www/play-demo/artifacts/caddy/logs:/var/log/caddy
- /var/www/play-demo/artifacts/server-0.1.0-SNAPSHOT:/var/www/demo.***.com
environment:
ACME_AGREE: 'true'
networks:
- play
ports:
- 80:80
- 443:443
networks:
play:
Caddyfile:
demo.***.com {
root /var/www/demo.***.com
proxy / play-demo:9443 {
transparent
}
log /var/log/caddy/demo.***.com-access.log
errors /var/log/caddy/demo.***.com-error.log
}
Errors and Access logs:
demo.***.com-access.log
*** - - [16/Jul/2019:10:53:57 +0000] "GET / HTTP/2.0" 499 5
*** - - [16/Jul/2019:10:54:00 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:03 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:03 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:17 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:18 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:26 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:27 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:29 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:30 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:36 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:54:37 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:55:11 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:55:11 +0000] "GET /favicon.ico HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:55:36 +0000] "GET / HTTP/2.0" 502 16
*** - - [16/Jul/2019:10:55:37 +0000] "GET /favicon.ico HTTP/2.0" 502 16
16/Jul/2019:10:53:57 +0000 [ERROR 499 /] context canceled
16/Jul/2019:10:54:00 +0000 [ERROR 502 /] read tcp 172.18.0.3:49554->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:03 +0000 [ERROR 502 /] read tcp 172.18.0.3:49556->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:03 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49558->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:17 +0000 [ERROR 502 /] read tcp 172.18.0.3:49562->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:18 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49564->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:26 +0000 [ERROR 502 /] read tcp 172.18.0.3:49566->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:27 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49568->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:29 +0000 [ERROR 502 /] read tcp 172.18.0.3:49570->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:30 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49572->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:36 +0000 [ERROR 502 /] read tcp 172.18.0.3:49574->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:54:37 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49576->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:55:11 +0000 [ERROR 502 /] read tcp 172.18.0.3:49578->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:55:11 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49580->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:55:36 +0000 [ERROR 502 /] read tcp 172.18.0.3:49586->172.18.0.2:9443: read: connection reset by peer
16/Jul/2019:10:55:37 +0000 [ERROR 502 /favicon.ico] read tcp 172.18.0.3:49588->172.18.0.2:9443: read: connection reset by peer
Please let me know if I can help with any more resources. I expected to maybe have some css and favicon.ico not accessible upon the first connection attempt, but this isn’t working at all. I am very new to Caddy and usually I find the example confs very useful, but there is not one for the Play framework.