404 에러
168
deo01
投稿した質問数 11
0
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으로 설정되어있습니다.
원인이 뭘까요??
docker
ubuntu
docker-swarm
orchestration
cloud-computing
回答 1
0
[에러 해결]
services:
traefik:
...
command:
....
# - --providers.swarm.constraints=Label(`traefik.constraint-label`, 'traefik-public')위 코드 주석하니 정상적으로 접속 됩니다 (+ SSL 인증까지 완료) 이유가 뭐였을까요?
!!!!!강의내용 틀린 부분 수정좀 해줘요!!!!!!!
1
7
0
python run.py 실행시 에러 문제
0
10
1
커서창
1
18
2
강의 제작
1
17
1
cursor 환경
1
17
2
개발 환경 준비와 프로젝트 구조 강의 관련
1
13
2
저장 공간
1
27
2
astro dev start 시 오류 발생
0
32
2
colab 코드 실행시 error
1
36
2
맥-openclaw.json 파일 없음.
0
73
5
VIM - Vi Improved
0
36
1
llm_decision_logs 저장 실패(실적 컬럼 불일치)를 어떻게 해결할까요?
2
52
3
컨트롤러
1
55
2
네임스페이스+파드
0
60
3
백엔드 이미지
0
43
1
수업 자료 사이트가 또 바뀌었을까요?
0
35
1
강의영상 과 자료
0
61
2
IP 가 어딨나요?
1
56
2
설치 문제 없는건가요?
1
44
1
xshell 접속오류
1
59
2
Docker Swarm과 Traefik을 활용한 MSA 아키텍처 설계 방식
0
190
1
질문드립니다.
0
115
1
도메인을 구매 안했다면
0
156
2
13:00
0
173
2

