gpt4 book ai didi

apache - 如何在多个端口(tcp 和 udp)上设置反向代理

转载 作者:行者123 更新时间:2023-12-02 08:57:36 27 4
gpt4 key购买 nike

我已经为网站设置了反向代理,现在我想使用下面所述的端口代理我的游戏服务器,但我真的找不到任何地方如何执行此操作。有人有想法吗?如果可能的话,我想在 apache 上这样做。我在 ubuntu 上运行。

RDP

TCP 端口:3389

MSSQL

TCP 端口:1143

团队演讲

UDP端口:9987TCP端口:9987TCP端口:10011TCP端口:30033

登录服务器

TCP 端口:15001TCP端口:15100

游戏服务器

TCP 端口:15221

FTP

21

最佳答案

Apache 不是代理 TCP 连接的理想工具。Nginx plus can do it 但它不是免费的

你想要的是像 squid 这样的代理服务器这是有详细记录的。

您也可以在不需要额外软件的情况下完成此操作,只需使用 IP 表,如所述 here .

iptables -t nat -A PREROUTING -p tcp --dport 1111 -j DNAT --to-destination ip:port
iptables -t nat -A PREROUTING -p tcp --dport 1112 -j DNAT --to-destination ip:port
iptables -t nat -A PREROUTING -p tcp --dport 1113 -j DNAT --to-destination ip:port
iptables -t nat -A POSTROUTING -j MASQUERADE

关于apache - 如何在多个端口(tcp 和 udp)上设置反向代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32619379/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com