如何在几个端口上设置反向代理(TCP&UDP) [英] How to setup a reverse proxy on several ports (tcp & udp)
问题描述
我已经为网站设置了反向代理,现在我想使用下面所述的端口来代理我的游戏服务器,但是我真的找不到任何方法来执行此操作.有人有主意吗? 我想在apache上做到这一点.在ubuntu上运行.
I have setup a reverse proxy for the website, and now I want to proxy my game server aswell with the ports stated below, but I realy can't find anywhere how to perform this. Does anyone have an idea? I would like to do this if possible on apache. Am running on ubuntu.
RDP
TCP端口:3389
TCP Port: 3389
MSSQL
TCP端口:1143
TCP Port: 1143
TEAMSPEAK
UDP端口:9987 TCP端口:9987 TCP端口:10011 TCP端口:30033
UDP Port: 9987 TCP Port: 9987 TCP Port: 10011 TCP Port: 30033
登录服务器
TCP端口:15001 TCP端口:15100
TCP Port: 15001 TCP Port: 15100
GAMESERVER
TCP端口:15221
TCP Port: 15221
FTP
21
推荐答案
Apache并不是代理TCP连接的理想工具.
Nginx plus 可以做到 但它不是免费的.
Apache is not an ideal tool for proxying TCP connections.
Nginx plus can do it but it's not free.
您想要的是一个代理服务器,例如 squid ,该文件已被很好地记录在案
What you want is a proxy server like squid which is very well documented.
您也可以仅使用IP表来执行此操作,而无需额外的软件,只需使用
You can also do this without extra software, just with IP tables as explained 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
这篇关于如何在几个端口上设置反向代理(TCP&UDP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!