404 에러
172
11 asked
traefik.yaml
services:
traefik:
image: traefik
ports:
- target: 80
published: 80
mode: host
protocol: tcp
- target: 443
published: 443
mode: host
protocol: tcp
- 9001:9001
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/log/traefik:/var/log/traefik
- traefik-certificates:/certificates
deploy:
mode: global
placement:
constraints:
- node.labels.traefik-public.traefik-certificates == true
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.routers.traefik-public-http.rule=Host(`test.shop`)
- traefik.http.routers.traefik-public-http.entrypoints=traefik-ui
- traefik.http.routers.traefik-public-http.middlewares=https-redirect
- traefik.http.routers.traefik-public-https.rule=Host(`test.shop`)
- traefik.http.routers.traefik-public-https.entrypoints=traefik-ui
- traefik.http.routers.traefik-public-https.tls=true
- traefik.http.routers.traefik-public-https.service=api@internal
- traefik.http.routers.traefik-public-https.tls.certresolver=le
- traefik.http.routers.traefik-public-https.middlewares=admin-auth
- traefik.http.services.traefik-public.loadbalancer.server.port=8080
- "traefik.http.middlewares.non-www-to-www.redirectregex.regex=^https?://(?:www\\.)?(.+)"
- "traefik.http.middlewares.non-www-to-www.redirectregex.permanent=true"
- "traefik.http.middlewares.non-www-to-www.redirectregex.replacement=https://www.$${1}"
update_config:
order: stop-first
command:
- --providers.swarm.network=traefik-public
- --providers.swarm.constraints=Label(`traefik.constraint-label`, 'traefik-public')
#v3 버전 전용 코드
- --providers.swarm.exposedbydefault=false
- --providers.swarm.endpoint=unix:///var/run/docker.sock
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --certificatesresolvers.le.acme.email=email
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --accesslog.bufferingsize=100
- --accesslog.filepath=/var/log/traefik/traefik-access.log
- --accesslog.fields.defaultmode=keep
- --accesslog.fields.names.ClientUsername=drop
- --accesslog.fields.headers.defaultmode=keep
- --accesslog.fields.headers.names.User-Agent=keep
- --accesslog.fields.headers.names.Authorization=drop
- --accesslog.fields.headers.names.Content-Type=keep
- --log
- --api
- --entrypoints.traefik-ui.address=:9001
networks:
- "traefik-public"
volumes:
traefik-certificates: {}
networks:
traefik-public:
name: traefik-public
external: true
app.yaml
services:
flask:
image: 192.168.219.114:5000/fastapi-helloworld
networks:
- traefik-public
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.flask.rule=Host(`test.shop`)"
- "traefik.http.routers.flask.entrypoints=http"
- "traefik.http.routers.flask.middlewares=https-redirect"
- "traefik.http.routers.flask-https.rule=Host(`test.shop`)"
- "traefik.http.routers.flask-https.entrypoints=https"
- "traefik.http.routers.flask-https.tls=true"
- "traefik.http.routers.flask-https.tls.certresolver=le"
- "traefik.docker.network=traefik-public"
- "traefik.constraint-label=traefik-public"
- "traefik.http.services.flask-https.loadbalancer.server.port=8080"
networks:
traefik-public:
name: traefik-public
external: true
stack 배포하고 test.shop 접속 시 404 에러가 발생합니다.
현재 애플리케이션 컨테이너의 포트는 8080으로 설정되어있습니다.
원인이 뭘까요??
Answer 1
0
[에러 해결]
services:
traefik:
...
command:
....
# - --providers.swarm.constraints=Label(`traefik.constraint-label`, 'traefik-public')위 코드 주석하니 정상적으로 접속 됩니다 (+ SSL 인증까지 완료) 이유가 뭐였을까요?
llm_decision_logs 미적재 문의
0
4
1
안녕하세요 도커실행과 관련해서 질문드립니다.
0
3
0
연동 문제
0
15
1
EC2 인스턴스 생성시
0
9
0
Issuance 테이블에 status, couponId 인덱스가 꼭 필요할까요?
2
17
1
5-21 질문이요!
0
20
2
도메인 필수 구매 여부
0
17
1
매수 실행 시점 관련
0
28
0
Opus/Sonnet 버전 관련 문의
1
46
2
부하 테스트 시 설정 관련 질문드립니다
1
59
1
섹션2 질문이요
1
49
2
"도커 이미지 생성" 18:59부분에 텍스트 파일로 정리 된거는 어디서 볼수 있나요?
0
43
1
섹션1.9 질문입니다!
1
70
3
Kaggle 노트북(predict.ipynb) 관련
1
54
2
git bash .env
1
54
1
kafka 이벤트 발행 실패 시 at-least-once를 보장하는 방법이 궁금합니다.
1
91
1
domain에 @Entity 와 Repository를 함께 둔 이유가 궁금합니다
1
78
1
혹시 강의 내용하면서 실습했던 것을 개인 깃에다 올려도 될까요?
0
45
1
알파벤티지 sleep(5) 관련 문의
1
70
2
Jib 이미지 빌드에서 docker credential 관련으로 이슈가 있다면
1
100
1
Docker Swarm과 Traefik을 활용한 MSA 아키텍처 설계 방식
0
200
1
질문드립니다.
0
124
1
도메인을 구매 안했다면
0
166
2
13:00
0
179
2

