3.1 KiB
Setting Up Coolify Deployment Behind an Existing Traefik Proxy
This guide explains how to configure your existing Traefik instance (running at 192.168.88.10) to proxy traffic to a Coolify-deployed jobs-app service running on 192.168.88.13:8001.
Prerequisites
- Traefik is running and accessible at
192.168.88.10 - Your external IP is configured to point to Traefik for domain resolution
- The jobs-app is deployed via Coolify and running on
192.168.88.13:8001 - You have access to Traefik's configuration files (assuming file-based provider)
Step 1: Verify Jobs-App Accessibility
Ensure the jobs-app is running and accessible:
curl http://192.168.88.13:8001
You should receive a response from the Flask application.
Step 2: Configure Traefik
Since Traefik is on a separate machine (192.168.88.10) and cannot directly watch the Docker containers on 192.168.88.13, you'll need to manually configure the routing in Traefik's configuration.
Option 1: Using Traefik's File Provider
Add the following configuration to your Traefik dynamic configuration file (e.g., dynamic.yml):
http:
routers:
jobs-app:
rule: "Host(`your-domain.com`)" # Replace with your actual domain
service: jobs-app
entryPoints:
- https # Assuming Traefik handles SSL termination
middlewares:
- https-redirect # Optional: redirect HTTP to HTTPS
services:
jobs-app:
loadBalancer:
servers:
- url: "http://192.168.88.13:8001"
middlewares:
https-redirect:
redirectScheme:
scheme: https
permanent: true
Option 2: Using Docker Labels (if Traefik can access the Docker socket)
If Traefik has access to the Docker socket on 192.168.88.13 (e.g., via network mount or API), the Docker labels in docker-compose.yml will automatically configure the routing. No additional configuration is needed.
Step 3: Reload Traefik Configuration
After updating the configuration, reload Traefik:
# If using Docker
docker-compose restart traefik
# Or if running directly
systemctl reload traefik
Step 4: Test the Setup
- Ensure your DNS points
your-domain.comto your external IP, which routes to Traefik. - Visit
https://your-domain.comin your browser. - Traefik should proxy the request to
http://192.168.88.13:8001and serve the jobs-app.
Troubleshooting
- Port not accessible: Ensure firewall rules allow traffic from
192.168.88.10to192.168.88.13:8001. - SSL issues: If Traefik is not terminating SSL, adjust the
entryPointsand remove HTTPS redirects. - Routing not working: Check Traefik logs for errors in router/service configuration.
- Domain mismatch: Verify the
Hostrule matches your actual domain.
Notes
- The jobs-app runs on port 8000 internally in the container, exposed on host port 8001.
- If you need to change the external port, update the
portsmapping indocker-compose.ymland the Traefik service URL accordingly. - For production, consider adding authentication, rate limiting, or other middlewares in Traefik.