将端口80从服务器上的8080转发到8080,可以阻止8080端口的用户访问我的网站吗? [英] Forward port 80 to 8080 on my server will users that block port 8080 be able to access my website?

查看:247
本文介绍了将端口80从服务器上的8080转发到8080,可以阻止8080端口的用户访问我的网站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在端口8080上的tomcat的Web应用程序.需要从非常严格的防火墙后面访问该应用程序.将端口80转发到8080是否允许防火墙后面的用户阻止8080访问应用程序?

I have a web application running on tomcat at port 8080. The application needs to be accessible from behind a very strict firewall. Will forwarding port 80 to 8080 allow users behind the firewall blocking 8080 to access the application?

如果没有,我还有什么其他选择?

If not, what other options do I have?

第1步:查看当前的防火墙规则

Step 1: View current firewall rules

sudo ipfw show

第2步:添加端口转发规则(从80到8080)

Step 2: Add port forwarding rule (80 to 8080)

运行Tomcat的默认端口是8080,因此在这里我们显示了将端口从端口80转发到8080(Tomcat的默认端口)的命令.显然,这也适用于其他端口,您只需要相应地调整命令即可.

The default port that Tomcat runs on is 8080, so here we show the command to do port fowarding from port 80 to 8080 (Tomcat’s default port). Obviously, this works for other ports as well, and you’d just have to adjust the command accordingly.

sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in

这是一个临时更改,重新启动后将还原.如果要使其永久存在,可以为其创建劳克恶魔.

This is a temporary change, and it will revert once you reboot. If you want to make it permanent, you can create a lauch deamon for it.

可选的删除规则

如果要删除防火墙规则,请运行:

If you want to remove your firewall rules run:

sudo ipfw flush

推荐答案

是的,因为转发是在您的计算机上完成的,因此看起来就像在端口80上一样.工作正常.

Yes it will work, since the forwarding is done on your machine it looks to the outside as if it were on port 80. We had a similar set up and it worked fine.

当然,如果防火墙非常严格,它们可能还有其他可能会干扰的阻止规则(也许它们仅允许某些IP通过).

Of course if the firewall is very strict they might have other blocking rules that could interfere (perhaps they only allow certain IPs through).

这篇关于将端口80从服务器上的8080转发到8080,可以阻止8080端口的用户访问我的网站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆