NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
JerAxxxx
1.54D
V2EX  ›  NGINX

如何使用 Kong lua 插件对上游请求直接返回文件

  •  
  •   JerAxxxx · Mar 9, 2023 · 1755 views
    This topic created in 1173 days ago, the information mentioned may be changed or developed.

    目前需求是, 使用 nginx 或 OpenResty 或 Kong 做一个前置机的功能。

    1. 请求文件下载接口后,将文件缓存在服务器
    2. 再次请求后,如果存在文件,直接返回给上游,不经过下游

    想请问下大佬们,看了下 Kong 的 api ,kong.Response.Exit(200, "body", "headers") 好像只有这个方法直接返回,如果返回文件流的格式应该怎么操作呢?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   947 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:06 · PVG 04:06 · LAX 13:06 · JFK 16:06
    ♥ Do have faith in what you're doing.