-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
server: | ||
port: 8080 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:8761/eureka | ||
|
||
# default profile | ||
spring: | ||
application: | ||
name: apigateway-service | ||
profiles: | ||
active: dev | ||
--- | ||
spring: | ||
config: | ||
activate: | ||
on-profile: dev | ||
cloud: | ||
gateway: | ||
routes: # 라우팅 설정 | ||
- id: first-service # 구분하기 위한 id값으로 임의로 작성해도 무관 | ||
predicates: # 조건 | ||
- Path=/dev/** # first-service/ 으로 요청이 들어오면 | ||
uri: lb://dev # 유레카 서버에서 MY-FIRST-SERVICE를 찾아서 그곳으로 요청을 보낸다. | ||
filters: | ||
# url 재정의 | ||
# ?<변수명>은 뒤에 나오는 정규식을 변수처럼 사용할 수 있도록 한다. ()는 하나의 묶음 처리 -> segment는 (.*)를 의미 | ||
# 콤마(,)를 기준으로 왼쪽 url을 오른쪽 url로 재정의한다. | ||
# 콤마 기준 오른쪽 부분은 ${변수명}으로 url 가져오고 앞에 / 붙여준거라고 보면 된다. | ||
- RewritePath=/dev/(?<segment>.*), /$\{segment} | ||
- id: second-service | ||
predicates: | ||
- Path=/release/** | ||
uri: lb://release | ||
filters: | ||
- RewritePath=/release/(?<segment>.*), /$\{segment} |