Forward port 80 to 8080 on my server will users that block port 8080 be able to access my website? [closed]

℡╲_俬逩灬. 提交于 2020-01-03 16:35:12

问题


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?

I follow these instructions for port forwarding

Step 1: View current firewall rules

sudo ipfw show

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

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.

Optional Remove Rule

If you want to remove your firewall rules run:

sudo ipfw flush


回答1:


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.

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



来源:https://stackoverflow.com/questions/12872051/forward-port-80-to-8080-on-my-server-will-users-that-block-port-8080-be-able-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!