V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
Achilless
V2EX  ›  NGINX

nginx 如何正向代理 tcp/udp 流量

  •  
  •   Achilless · 213 天前 · 678 次点击
    这是一个创建于 213 天前的主题,其中的信息可能已经有所发展或是发生改变。

    七层流量可以这样实现正常请求 proxy_pass $scheme://$http_host$request_uri;

    四层流量貌似没有类似变量 proxy_pass $origin_dst

    具体需求是,通过 nginx 对通过的 tcp/udp 流量加 proxy_protocol ,但是不要修改目标 ip 和端口,查了下 lua 貌似也取不到这个信息,挺意外的。有其他办法吗

    yinmin
        1
    yinmin  
       200 天前 via iPhone
    stream {
    server {
    listen 12345;
    proxy_pass 127.0.0.1:54321;
    }
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2948 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:04 · PVG 22:04 · LAX 07:04 · JFK 10:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.