zar3bski opened a new issue, #7882:
URL: https://github.com/apache/apisix/issues/7882

   ### Description
   
   I feel dumb by not finding it by myself but this behavior is quite 
surprising. I have the following route pointing to an elasticsearch kubernetes 
service
   
   ```json
   {
     "uri": "/elastic/*",
     "name": "elastic",
     "methods": [
       "GET",
       "POST",
       "PUT",
       "DELETE",
       "PATCH",
       "HEAD",
       "OPTIONS",
       "CONNECT",
       "TRACE"
     ],
     "upstream": {
       "nodes": [
         {
           "host": "elasticsearch-es-internal-http.default.svc",
           "port": 9200,
           "weight": 1
         }
       ],
       "timeout": {
         "connect": 6,
         "send": 6,
         "read": 6
       },
       "type": "roundrobin",
       "scheme": "https",
       "pass_host": "pass",
       "keepalive_pool": {
         "idle_timeout": 60,
         "requests": 1000,
         "size": 320
       }
     },
     "status": 1
   }
   ```
   When I reach the service through **apisix-gateway** with `curl 
http://localhost:30532/elastic/`, I would expect to end up on the root of the 
web service and to get 
   
   ```json
   {
     "name" : "elasticsearch-es-master-0",
     "cluster_name" : "elasticsearch",
     "cluster_uuid" : "qCuSnxgLTOSklJM13cH3XA",
     "version" : {
       "number" : "8.2.2",
       "build_flavor" : "default",
       "build_type" : "docker",
       "build_hash" : "9876968ef3c745186b94fdabd4483e01499224ef",
       "build_date" : "2022-05-25T15:47:06.259735307Z",
       "build_snapshot" : false,
       "lucene_version" : "9.1.0",
       "minimum_wire_compatibility_version" : "7.17.0",
       "minimum_index_compatibility_version" : "7.0.0"
     },
     "tagline" : "You Know, for Search"
   }
   ```
   (which is what I get when I `curl 
https://elasticsearch-es-internal-http.default.svc:9200`). Instead, I get 
   
   ```json
   {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no 
such index 
[elastic]","resource.type":"index_or_alias","resource.id":"elastic","index_uuid":"_na_","index":"elastic"}],"type":"index_not_found_exception","reason":"no
 such index 
[elastic]","resource.type":"index_or_alias","resource.id":"elastic","index_uuid":"_na_","index":"elastic"},"status":404}
   ```
   as if I were reaching 
`https://elasticsearch-es-internal-http.default.svc:9200/elastic`. 
   
   How to remove `/elastic` from the call to the upstream service ?
   
   ### Environment
   
   - APISIX version: 2.15.0
   - Operating system (run `uname -a`):
   - OpenResty version : 1.21.4.1 / 
   - etcd version:8.3.4
   
   Deployed with Helm
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to