<p>I have a service with ingress of <code>/api/my-service</code></p>
<p>My kong configuration look like this:</p>
<pre><code>services:
  - name: myService
    protocol: http
    host: myservice.mynamespace
    port: 8080
    path: /
    plugins:
      - name: jwt
        config:
           key_claim_name: iss
           claims_to_verify:
             - exp
    routes:
      - tags:
          - OAS3_import
          - OAS3file_openapi.json
        name: myservice-backend
        methods:
          - GET
        paths:
          - /api/my-service/v0/contexts
        strip_path: false
      - tags:
</code></pre>
<p>When I request <code>http://kongProxy/api/my-service/v0/myEndpoint</code> I want kong to create an upstream request like <code>http://my-service/v0/myEndpoint</code></p>
<p>I thought I can use the strip_path setting, but that strips the suffix, not the prefix.</p>
<p>I looked at the request transformer but looks like an overkill for something like that. And I prefer to avoid it because the cong image has been provided to me and would like to avoid having to request modifications.</p>
<p>Any ideas?</p>

ventsyv
<p>To get what you desire, your config should look like:</p>
<pre><code>services:
  - name: myService
    protocol: http
    host: myservice.mynamespace
    port: 8080
    path: /
    plugins:
      - name: jwt
        config:
           key_claim_name: iss
           claims_to_verify:
             - exp
    routes:
      - tags:
          - OAS3_import
          - OAS3file_openapi.json
        name: myservice-backend
        methods:
          - GET
        paths:
          - /api/my-service
        strip_path: true
      - tags:
</code></pre>
<p>Then, a request to</p>
<p>http://kongProxy/api/my-service/v0/myEndpoint</p>
<p>will be sent to</p>
<p><a href="http://myservice.mynamespace:8080/v0/myEndpoint" rel="nofollow noreferrer">http://myservice.mynamespace:8080/v0/myEndpoint</a></p>
