We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 example.com/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 left intact
这个是否只能开发自定义插件解决了呢 QAQ
apisix version
uname -a
openresty -V
nginx -V
curl http://127.0.0.1:9090/v1/server_info
luarocks --version
The text was updated successfully, but these errors were encountered:
个人感觉,可能的两种方法:
1 用apisix 来处理这个302, 添加一条route, 直接把 / 代理到 /index.html 2. 用response_write, 把302的返回,添加你的 “hdfs” 这段代理头
Sorry, something went wrong.
@wfy-belief 你可以使用 ApisixUpstream 的 healthCheck.active 主动健康检测9870端口的 /isActive 路径,这个在haproxy中很好实现 可以参考https://dyrnq.com/hadoop-namenode-ha/#%e8%a7%a3%e5%86%b3
No branches or pull requests
Description
然后我请求这个路径的 curl 如下
这个是否只能开发自定义插件解决了呢 QAQ
Environment
apisix version
):uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: