From a88bd7f85994d6f24792e91aa1b1576da17ca27f Mon Sep 17 00:00:00 2001 From: su chen Date: Mon, 25 Mar 2024 19:00:13 +0800 Subject: [PATCH] optim doc (#1242) * optim doc * Update docs/01.Getting-Started/1.1.Quick-Start.md Co-authored-by: Yun Long --------- Co-authored-by: Yun Long --- docs/01.Getting-Started/1.1.Quick-Start.md | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/01.Getting-Started/1.1.Quick-Start.md b/docs/01.Getting-Started/1.1.Quick-Start.md index a39b7dbf69..1827bc1fb4 100644 --- a/docs/01.Getting-Started/1.1.Quick-Start.md +++ b/docs/01.Getting-Started/1.1.Quick-Start.md @@ -33,7 +33,8 @@ Assuming you have two backend HTTP services running at `127.0.0.1:9095` and `127 ```bash $ egctl create httpproxy demo --port 10080 \ - --rule="/pipeline=http://127.0.0.1:9095,http://127.0.0.1:9096" + --rule="/pipeline=http://127.0.0.1:9095,http://127.0.0.1:9096" \ + --rule="/prefix*=http://127.0.0.1:9097" ``` Then try it: @@ -43,6 +44,12 @@ $ curl -v 127.0.0.1:10080/pipeline The request will be forwarded to either `127.0.0.1:9095/pipeline` or `127.0.0.1:9096/pipeline`, utilizing a round-robin load-balancing policy. +```bash +$ curl -v 127.0.0.1:10080/prefix/123 +``` +The request will be forwarded to `127.0.0.1:9097/prefix/123`. + + ### YAML Configuration The `egctl create httpproxy` command mentioned above is actually syntactic sugar; it creates two Easegress resources under the hood: `HTTPServer` and `Pipeline`. @@ -58,7 +65,9 @@ https: false rules: - paths: - path: /pipeline - backend: demo-0' | egctl create -f - + backend: demo-0 + - pathPrefix: /prefix + backend: demo-1 ' | egctl create -f - ``` More details about [HTTPServer](../02.Tutorials/2.2.HTTP-Proxy-Usage.md). @@ -76,7 +85,18 @@ filters: - url: http://127.0.0.1:9095 - url: http://127.0.0.1:9096 loadBalance: - policy: roundRobin' | egctl create -f - + policy: roundRobin +--- +name: demo-1 +kind: Pipeline +flow: + - filter: proxy +filters: + - name: proxy + kind: Proxy + pools: + - servers: + - url: http://127.0.0.1:9097' | egctl create -f - ``` More details about [Pipeline](../02.Tutorials/2.3.Pipeline-Explained.md).