Skip to content

Commit

Permalink
optim doc (#1242)
Browse files Browse the repository at this point in the history
* optim doc

* Update docs/01.Getting-Started/1.1.Quick-Start.md

Co-authored-by: Yun Long <[email protected]>

---------

Co-authored-by: Yun Long <[email protected]>
  • Loading branch information
suchen-sci and xxx7xxxx committed Mar 25, 2024
1 parent 15fcaa0 commit a88bd7f
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions docs/01.Getting-Started/1.1.Quick-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://127.0.0.1:9095,http:https://127.0.0.1:9096"
--rule="/pipeline=http:https://127.0.0.1:9095,http:https://127.0.0.1:9096" \
--rule="/prefix*=http:https://127.0.0.1:9097"
```

Then try it:
Expand All @@ -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`.
Expand All @@ -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).

Expand All @@ -76,7 +85,18 @@ filters:
- url: http:https://127.0.0.1:9095
- url: http:https://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:https://127.0.0.1:9097' | egctl create -f -
```
More details about [Pipeline](../02.Tutorials/2.3.Pipeline-Explained.md).

Expand Down

0 comments on commit a88bd7f

Please sign in to comment.