Hello, i have a react app that will be running on digital ocean droplet ubuntu using docker.
2. How I run Caddy:
Caddy is spin off with the docker images by running docker-compose up --build
a. System environment:
Docker/ubuntu
b. Command:
To run the app i run docker-compose which start docker and caddy
docker-compose up --build
c. Service/unit/compose file:
version: '3.7'
services:
cityhall_client:
container_name: cityhall_client
restart: unless-stopped
build:
context: ./
caddy:
image: caddy/caddy:2.2.1-alpine
container_name: caddy-service_clients
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- $PWD/site:/srv
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
d. My complete Caddyfile or JSON config:
city-hull.com {
encode gzip zstd
try_files {path} {path}/ /index.html. // not sure
reverse_proxy cityhall_client:3000 {
header_down Strict-Transport-Security max-age=31536000;
}
}
3. The problem I’m having:
the issue am having is that my app is not been serve in the browser when i visit the website. From the logos, i can see that the app is running.
I am not sure why it seems am not providing the right path of the html.
each time i visited the website caddy log error as shown below
4. Error messages and/or full log output:
´´´
{"level":"error","ts":1646382796.0507452,"logger":"http.log.error","msg":"dial tcp 172.18.0.3:3000: connect: connection refused","request":{"remote_addr":"83.243.138.106:53840","proto":"HTTP/2.0","method":"GET","host":"city-hull.com","uri":"/","headers":{"Sec-Fetch-User":["?1"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"],"Sec-Gpc":["1"],"Sec-Fetch-Site":["none"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"],"Sec-Fetch-Mode":["navigate"],"Accept-Language":["en-GB,en-US;q=0.9,en;q=0.8"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":"city-hull.com"}},"duration":0.015822865,"status":502,"err_id":"iy4wnkni1","err_trace":"reverseproxy.statusError (reverseproxy.go:886)"}
5. What I already tried:
I have tried changing the Caddyfile based on different source