github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/docs/proxy/append_uri_property.md (about)

     1  ##### The `append_path` property
     2  
     3  You might also want to always append the `listen_path` to the elected upstream target. 
     4  To do so, use the `append_path` boolean property by configuring an API like this:
     5  
     6  ```json
     7  {
     8      "name": "My API",
     9      "proxy": {
    10          "append_path" : true,
    11          "listen_path": "/service/*",
    12          "upstreams" : {
    13              "balancing": "roundrobin",
    14              "targets": [
    15                  {"target": "http://my-api.com/example"}
    16              ]
    17          },
    18      }
    19  }
    20  ```
    21  
    22  Enabling this flag instructs Janus that when proxying this API, it should **always**
    23  include the matching URI prefix in the upstream request's URI. For example, the
    24  following client's request to the API configured as above:
    25  
    26  ```http
    27  GET /service/path/to/resource HTTP/1.1
    28  Host: my-api.com
    29  ```
    30  
    31  Will cause Janus to send the following request to your upstream service:
    32  
    33  ```http
    34  GET /example/service/path/to/resource HTTP/1.1
    35  Host: my-api.com
    36  ```