-1

I have 2 machines

Machine A have two interfaces and webserver

eth0 is private ip 192.168.1.1 eth1 is public ip 1.2.3.4

Machine B eth0 is private ip 192.168.1.2 running tomcat(8080)

Now how can i access 192.168.1.2:8080 using my public ip

Any idea how to port forward this?


Thank you guys for your answers. I know how to use reverse proxy since my public ip contain a django application which run on port 8000. But my question is , is it possible to act my machine A as router of machine B. that will accept connection on port 8080.

2 Answers 2

0

I think your are looking for the reverse-proxy module of Apache.

Here is a howto, and the official doc. There are plenty of docs on the net.

This is also possible with nginx.

Regarding Tomcat application, also look here, as you probably want to tell Tomcat what its public address is.

0

SSH tunnel works, run in machine A:

ssh -f -L 3000:192.168.1.2:8080 localhost -N

You can change 3000 to 8080 (or any other port) if it not used by machine A.

Any connection to 192.168.1.1:3000 or 1.2.3.4:3000 will be forwarded to 192.168.1.2:8080.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .