Create SSH tunnel to access web pages running on localhost on another server.

There’s always new tricks to learn, here’s one I didn’t know about.
I needed to access a web page running on a server as localhost, accessing it through LAN did not let me access all features. What you need to do is create an SSH tunnel to that server so it thinks you’re accessing it locally.

On your client type this, assuming your web server is running on port 443.
ssh <your_server> -L 8888:localhost:443

By doing this you can access the page as localhost on your client by going to https://localhost:8888

Leave a Reply

Your email address will not be published. Required fields are marked *