V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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 · 1684 views
    This topic created in 1146 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   ·   5381 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 07:51 · PVG 15:51 · LAX 00:51 · JFK 03:51
    ♥ Do have faith in what you're doing.