Replies: 1 comment 5 replies
-
|
Hi @Arazmalek, Your Docker Compose and Caddy configuration look mostly correct. Here are some things to check: 1. Check Logto container logs firstdocker logs logto_appThis will tell you whether the 404 is coming from Logto itself or from somewhere else in the chain. 2. Verify database seeding completed successfullyMake sure you ran the seed command and it completed without errors: docker run --rm \n -e DB_URL="postgres://..." \n ghcr.io/logto-io/logto:latest \n npx @logto/cli db seedA 404 on the admin console often indicates the initial data wasn't created properly. 3. Test connectivity inside the containerdocker exec -it logto_app curl -I localhost:3002If this returns 404, the issue is with Logto itself. If it returns 200, the issue is with Caddy/networking. 4. Enhance your Caddyfile headersTry adding more forwarded headers: console-staging.met*** {
reverse_proxy logto:3002 {
header_up X-Forwarded-Proto https
header_up X-Forwarded-Host {host}
header_up X-Real-IP {remote_host}
}
}5. Check if it's a Caddy 404 or Logto 404Look at the response headers when you get the 404. A Caddy 404 will have Let us know what you find in the logs! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have staging enviroment on docker which uses Caddy. after seeding the db and docker compose up, when I go to admin I get a 404 error. Here I share my Docker compose file + my Caddy file. I appreciate if you can let me know whats wrong.
docker-compose.yml:
`services:
logto:
image: ghcr.io/logto-io/logto:latest
container_name: logto_app
restart: always
expose:
- "3001"
- "3002"
environment:
TRUST_PROXY: ""
ENDPOINT: "https://auth-staging.met**"
ADMIN_ENDPOINT: "https://console-staging.met****"
DB_URL: "postgres://.amazonaws.com:5432/logto_staging?sslmode=no-verify"
REDIS_URL: "redis://logto_redis:6379"
NODE_TLS_REJECT_UNAUTHORIZED: "0"
COOKIE_DOMAIN: "met*"
COOKIE_SECURE: "true"
depends_on:
- redis
redis:
image: redis:alpine
container_name: logto_redis
restart: always
command: redis-server --save 60 1 --loglevel warning
caddy:
image: caddy:latest
container_name: logto_caddy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- logto
volumes:
caddy_data:
caddy_config:`
Caddy file:
` GNU nano 7.2 Caddyfile *
auth-staging.met*** {
reverse_proxy logto:3001 {
header_up X-Forwarded-Proto https
}
}
console-staging.met*** {
reverse_proxy logto:3002 {
header_up X-Forwarded-Proto https
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions