istio virtual service 설정하는데 너무 한계가 많은거 아니냐.. 진짜 이거 별 공수도 안들거같은데 왜 이 기능이 없는지 모르겠음..
http:
- match:
- uri:
prefix: /static/css
route:
- destination:
host: ~~
subset: ~~
weight: 100
spec:
hosts:
- ~~.com
gateways:
- ~~-gateway
http:
- match:
- uri:
regex: '\/static\/css\/[0-9]+\/.*'
rewrite:
uri: /css
route:
- destination:
host: ~~
subset: ~~
weight: 100
내가 원하는건 /static/css/23802309/hello.css -> /css/hello.css 로 보내라는건데
이렇게 설정하면 바보같이 /static/css/23802309/hello.css -> /css
-> 아무것도 없어용 ㅜㅜ
이렇게 된다;
그래서
/static/css/23802309/hello.css -> /css/hello.css
/static/css/15674212/hello.css -> /css/hello.css
이거 할 수 있는 방법을 찾아봤더니 죽어도 없다. vs에서 prefix에서는 regex를 지원안해서 저 중간에 랜덤한 숫자 N개를 묶을 방법이 없다.
그치만 regex 에서는 뒤의 {{ hello.css }} 라는 거에 대한 regex capture group 도 지원안해서 결국 못한다는거.
진짜 어이없음. 어떻게든 해보려고 했는데 안됨 바이
https://docs.eupraxia.io/docs/how-to-guides/deploy-nginx-webserver-to-istio/
얘보고 희망 가졌는데.. 다시보니 얘는 rewrite이 아니라 그냥 라우팅하는 애라서 문제 없었겠네.. ㅋ
http:
- match:
- uri:
exact: /
- uri:
prefix: /docs
- uri:
regex: ^.*\.(ico|png|jpg|css|js|img|jpeg|map)$
route:
- destination:
host: docs-service
port:
number: 8080