How to setup a reverse proxy on several ports (tcp & udp)

后端 未结 1 1465
生来不讨喜
生来不讨喜 2020-12-19 22:14

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

相关标签:
1条回答
  • 2020-12-19 22:50

    Apache is not an ideal tool for proxying TCP connections. Nginx plus can do it but it's not free.

    What you want is a proxy server like squid which is very well documented.

    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
    
    0 讨论(0)
提交回复
热议问题