There are two computers at my work - one which has a public IP address and another computer which has an Apache server running a browser-based application on port 80. Port 80 of the computer with the public IP address receives traffic with the DNS public.domain.edu. Port 80 of the computer with the Apache server is not public, but can be accessed on the local network through private.domain.edu.
I want to create a local SSH tunnel from the public computer's port 80 to the computer with the Apache server implemented. So far, I have tried this command from the computer with the public IP address:
sudo ssh email@example.com -L 80:private.domain.edu:80
When I run this particular command, I can access the web application on private.domain.edu by running a browser on public.domain.edu and typing "localhost" in the address bar. However, when I type in public.domain.edu's IP address in the address bar, it does not tunnel to private.domain.edu's application but instead says that the URL could not be found. Moreover, when I type the DNS lookup for public.domain.edu on the address bar, it still does not work.
How do I fix the SSH tunnel it so that, when I type public.domain.edu (or its IP address) on the address bar, I access private.domain.edu's web application?