我已经为网站设置了反向代理,现在我想使用下面所述的端口代理我的游戏服务器,但我真的找不到任何地方如何执行此操作。有人有想法吗? 如果可能的话,我想在 apache 上这样做。我在 ubuntu 上运行。
RDP
TCP 端口:3389
MSSQL
TCP 端口:1143
团队演讲
UDP端口:9987 TCP端口:9987 TCP端口:10011 TCP端口:30033
登录服务器
TCP 端口:15001 TCP端口: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/