[SOLVED] 'ssh reverse tunneling to apache/httpd behind restrictive firewall' not working as expected using SSL

Issues related to configuring your network
aegersz
Posts: 44
Joined: 2016/04/04 07:42:58

[SOLVED] 'ssh reverse tunneling to apache/httpd behind restrictive firewall' not working as expected using SSL

Postby aegersz » 2017/07/17 12:33:35

Hi, I am at home behind a firewall that allows NO incoming connections. all my machines use ssh keys and SSL.

note: my-public-host is not my real public server's name, of course.

I can "ssh" into my machines at home from my-public-host (allows port 22) by using a ssh reverse tunnel:

home/client:
ssh -R 2222:localhost:22 my-public-host

my-public-host:
ssh -p 2222 localhost > I get to my home/client shell with no problems

BUT when i try to access my home/client website (uses port 8080) by pointing by browser (from anywhere) to http(s)://my-public-host:8080, i have no luck connecting. I have been trying this for hours and watching it in debug mode via:

ssh -vvv -R *:8080:localhost:8080 my-public-host

what am i doing wrong, please ? how can i get to my home webserver from a 3rd party client via a browser ?

However, if i issue curl localhost:8080 on my-public-host then I get traffic from home/client but NOT when i point my browser to it (?). my-public-host is a forum, btw.
Last edited by aegersz on 2017/07/21 12:26:35, edited 5 times in total.

aegersz
Posts: 44
Joined: 2016/04/04 07:42:58

Re: 'ssh reverse tunneling to httpd behind firewall' not working as expected

Postby aegersz » 2017/07/17 14:51:08

i worked it out. My .htaccess was forcing https traffic, see below.

Code: Select all

# redirect http to https
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://my-public-host/$1 [R=301,L]

so i had to use local port 443: (point my browser to my-public-host:8080)

ssh -R *:8080:localhost:443 my-public-host


Return to “CentOS 6 - Networking Support”

Who is online

Users browsing this forum: No registered users and 2 guests