1. Output of caddy version
:
v2.6.2
2. How I run Caddy:
on VPS for production
`
a. System environment:
ubuntu 20.18 with docker and docker compose,
b. Command:
Paste command here.
c. Service/unit/compose file:
version: "3.8"
volumes:
vol-emqx-data:
name: foo-emqx-data
vol-emqx-log:
name: foo-emqx-log
caddy_data:
external: true
caddy_config:
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges:true
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./portainer/portainer-data:/data
ports:
- 9000:9000
caddy:
image: caddy:latest
restart: unless-stopped
container_name: caddy
ports:
- 80:80
- 443:443
volumes:
- ./contenedores/caddy/Caddyfile:/etc/caddy/Caddyfile
- ./contenedores/caddy/site:/srv
- ./contenedores/caddy/caddy_data:/data
- ./contenedores/caddy/caddy_config:/config
node:
container_name: node
image: "node:14"
restart: always
working_dir: /home/node/app
volumes:
- ./app/:/home/node/app
ports:
- "3000:3000"
- "3001:3001"
- "3002:3002"
links:
- emqx
- mongo
command: sh -c "echo 'delaying 30 seconds' && sleep 30 && npm run start"
mongo:
container_name: mongo
image: mongo:4.4
restart: always
logging:
driver: "none"
environment:
TZ: "${TZ}"
MONGO_INITDB_ROOT_USERNAME: "${MONGO_USERNAME}"
MONGO_INITDB_ROOT_PASSWORD: "${MONGO_PASSWORD}"
volumes:
- ./mongodata:/data/db
ports:
- ${MONGO_EXT_PORT}:27017
emqx:
container_name: emqx
image: emqx/emqx:4.2.3
restart: always
ports:
- 18083:18083
- 1883:1883
- 1884:1884
- 8084:8084
- 8083:8083
- 8085:8081
volumes:
- vol-emqx-data:/opt/emqx/data
- vol-emqx-log:/opt/emqx/log
links:
- mongo
d. My complete Caddy config:
{
debug
}
example.com {
route /api/* {
uri strip_prefix /api
reverse_proxy node:3001
}
handle {
reverse_proxy node:3000
}
}
emqx.example.com {
reverse_proxy emqx:18083
}
ws.examplecom {
reverse_proxy emqx:8083
}
wss.example.com {
reverse_proxy emqx:8084
}
portainer.example.com {
reverse_proxy portainer:9000
}.
3. The problem I’m having:
The web conforms of the front end port “3000” and the back end port “3001” all the web is programed with nuxt, i can add https on front end but when i try to make a post (login in this case) trhows me ERR_SSL_PROTOCOLERRO with the api path
the login route is: https://example:3001/api/login/
also caddy does not respon to port 3001 its like its not there.
to be more clear the interna api is like this “example.com:3001/api/”