wfy-belief opened a new issue, #11358:
URL: https://github.com/apache/apisix/issues/11358

   ### Description
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: hadoop-route
   spec:
     http:
       - name: namenode
         match:
           hosts:
             - example.com
           paths:
             - /hdfs/*
         backends:
           - serviceName: namenode-service
             servicePort: 9870
         plugins:
           - name: proxy-rewrite
             enable: true
             config:
               regex_uri: [ "^/hdfs/(.*)", "/$2" ]
   #        - name: response-rewrite
   #          enable: true
   #          config:
   #            status_code: 302
   #            # "body": "{\"code\":\"ok\",\"message\":\"new json body\"}"
   #            headers:
   #              set:
   #                X-Server-id: 3
   #                X-Server-status: 'on'
   #                X-Server-balancer-addr: '$balancer_ip:$balancer_port'
   #                Location: example.com/hdfs/
   #            vars:
   #              - "[ \"status\",\"==\",403 ]"
   ```
   
   然后我请求这个路径的 curl 如下
   ```
   curl acitrus.cn/hdfs/ -vl
   * Host  example.com:80 was resolved.
   * IPv6: (none)
   * IPv4: xxxxx
   *   Trying xxxx:80...
   * Connected to  example.com (xxxx) port 80
   > GET /hdfs/ HTTP/1.1
   > Host:  example.com
   > User-Agent: curl/8.6.0
   > Accept: */*
   >
   < HTTP/1.1 302 Found
   < Content-Type: text/plain;charset=utf-8
   < Content-Length: 0
   < Connection: keep-alive
   < Date: Mon, 17 Jun 2024 12:53:07 GMT
   < Cache-Control: no-cache
   < Expires: Mon, 17 Jun 2024 12:53:07 GMT
   < Pragma: no-cache
   < X-Content-Type-Options: nosniff
   < X-FRAME-OPTIONS: SAMEORIGIN
   < X-XSS-Protection: 1; mode=block
   < Location: http:// example.com/index.html
   < Server: APISIX/3.9.1
   <
   * Connection #0 to host acitrus.cn left intact
   ```
   
   这个是否只能开发自定义插件解决了呢 QAQ
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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