I am new to Traefik and trying to set up Traefik as a reverse proxy. Here is my Compose file:
version: "3.7"
services:
frontend:
build:
context: ./frontend
expose:
- 80
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.routers.frontend.rule=Host(`localhost:7000`)"
proxy:
image: traefik:v2.6
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "7000:80"
- "7001:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
The frontend
service is just an NGINX server that serves a web app. When I tried to access the web app via http://localhost:7000
, I got a 404 error. Did I get anything wrong?
Thanks in advance!