Reverse Proxy
애플리케이션 서버 앞에 Fluxheim을 둡니다. Fluxheim이 TLS, header, limit, upstream selection을 처리합니다.
Basic proxy
[[vhosts]]
name = "app"
hosts = ["app.example.com"]
[[vhosts.routes]]
path_prefix = "/"
action = "proxy"
upstreams = ["127.0.0.1:3000"]
route 선택
| feature | 사용할 때 |
|---|---|
path_exact | 하나의 URL에 precise route가 필요합니다. |
path_prefix | 전체 URL subtree가 하나의 backend로 갑니다. |
strip_prefix | backend가 public prefix를 보면 안 됩니다. |
rewrite_prefix | backend가 다른 internal prefix를 기대합니다. |
methods | route가 선택된 HTTP method만 허용해야 합니다. |
path rewrite 예제
[[vhosts.routes]]
name = "api"
path_prefix = "/api/"
strip_prefix = "/api/"
rewrite_prefix = "/internal/"
[vhosts.routes.proxy]
upstreams = ["10.0.0.20:8080"]
connect_timeout_secs = 5
read_timeout_secs = 30
send_timeout_secs = 30
프로덕션 참고
- 애플리케이션은 loopback 또는 private network에 유지하세요.
- 업로드를 노출하기 전에 request body limit을 설정하세요.
- Use trusted proxy settings only for networks you control.
- 서로 다른 path에 서로 다른 safety rule이 필요하면 하나의 큰 fallback보다 explicit route를 선호하세요.