简体   繁体   English

配置代理到期iptables

[英]Configuration proxy due iptables

i have to configure my server to redirect from 80 and 443 port due to 8443 using iptables 我必须将服务器配置为由于使用iptables而从80和443端口重定向到8443

          -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
          -A INPUT -p tcp -m tcp --dport 8443 -j ACCEPT
          -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
          -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
          -A PREROUTING -i eth0 -p tcp -m tcp --dport 80:443 -j REDIRECT --to-ports 8443

when i browse like https protocol everything is working, but when from http, i can just donwnload a file, and don't see anything 当我像https协议一样浏览时,一切正常,但是当从http浏览时,我只能下载文件,什么也看不到

8443 port is intended mainly to use as HTTPS proxy. 8443端口主要旨在用作HTTPS代理。 Sending plain HTTP to this port will not work. 纯HTTP发送到该端口将不起作用。 You should keep separated HTTP and HTTPS traffic by sending them to a different port (normally 8080) of your transparent proxy. 您应该通过将HTTP和HTTPS通信发送到透明代理的其他端口(通常为8080)来保持分离。

using this rule : -A PREROUTING -i eth0 -p tcp -m tcp --dport 80:443 -j REDIRECT --to-ports 8443 使用以下规则:-A PREROUTING -i eth0 -p tcp -m tcp --dport 80:443 -j REDIRECT --to-ports 8443

you allowed only incoming traffic to to be sent to port 8443, but still the outgoing traffic needs to be routed 您只允许将传入流量发送到端口8443,但是仍然需要路由传出流量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM