인프라/시스템 구축

[ istio ] Domain Redirect 설정

김붕어87 2023. 6. 29. 16:31
반응형
dongwook.com  -> www.dongwook.com으로 리다이렉트 설정입니다.
설정은 istio VirtualService 리소스를 가지고 설정했습니다.

 

 

1. VirtualService.yaml 수정

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: dongwook-virtualservice
  namespace: default
spec:
  gateways:
    - istio-system/http-gateway
  hosts:
    - app.dongwook.com
    - www.dongwook.com
    - dongwook.com
  http:
    - match:
        - authority:
            exact:
              dongwook.com
      redirect:
        authority: www.dongwook.com
    - match:
        - uri:
            prefix: /services/game-admin
      route:
        - destination:
            host: prod-dongwook-admin
            port:
              number: 80
      headers:
        request:
          set:
            X-Forwarded-Proto: https
            X-Forwarded-Port: "443"
    - match:
        - uri:
            prefix: /services/game
      route:
        - destination:
            host: prod-dongwook-app
            port:
              number: 80
      headers:
        request:
          set:
            X-Forwarded-Proto: https
            X-Forwarded-Port: "443"
    - route:
        - destination:
            host: prod-dongwook-frontend
            port:
              number: 80

 

 

2. Domain Redirect 테스트

  • dongwook.com 접속 시 www.dongwook.com 변경 확인
반응형

'인프라 > 시스템 구축' 카테고리의 다른 글

[ EBS ] PV, PVC, POD 배포  (0) 2023.06.29
[ istio ] ALB 설정 (Internal,Internet-facing)  (0) 2023.06.29
[ EKS ] Configmap - 2  (0) 2023.04.19
[ EKS ] Nginx-Ingress  (0) 2023.04.18
[ istio ] Install  (0) 2023.04.13