apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: apisix how implement the try_files feature

Open zzqCh opened this issue 2 years ago • 7 comments

Description

the nginx document is : https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

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

zzqCh avatar Aug 08 '23 06:08 zzqCh

Whar do you want it for? Please describe your use case.

shreemaan-abhishek avatar Aug 09 '23 05:08 shreemaan-abhishek

Whar do you want it for? Please describe your use case.

I think the advantage of APISIX is that it can replace nginx and supports dynamic features, but I don't see any replacement for try-files at the moment, so I would like to know how to implement the try-files functionality.

zzqCh avatar Aug 14 '23 00:08 zzqCh

Do you have a use case? I do not fully understand the try-flies feature, your use case scenario might help me understand.

shreemaan-abhishek avatar Aug 14 '23 09:08 shreemaan-abhishek

Do you have a use case? I do not fully understand the try-flies feature, your use case scenario might help me understand.

Now there is a route,the path is /a, when a client access /a, the apisix needs to access /a/b and /a/c of the backend service in orderly(if /a/b returns 200 then end the request, otherwise continue with the request /a/b), and /b and /c are actually configured in the try-files plugin of the /a route

zzqCh avatar Aug 15 '23 00:08 zzqCh

This feature isn't yet supported, would you like to submit a PR for this feature?

shreemaan-abhishek avatar Aug 15 '23 06:08 shreemaan-abhishek

This feature isn't yet supported, would you like to submit a PR for this feature?

I don't know how to implement it, I considered intercept the request (such as before_proxy phase) before forwarding to the upstream, then send requests using resty library, but this approach will cause the upstream_status and other information to be empty, do you have a good solution?

zzqCh avatar Aug 15 '23 12:08 zzqCh

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Jul 31 '24 10:07 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Aug 15 '24 10:08 github-actions[bot]