I have an issue with access to web page that opens via ssh port forwarding:
I do:
ssh [email protected] -L 7182:10.1.11.82:80
172.22.123.71 is a PC which has access to srever's 10.1.11.82 network
Then I open in browser localhost:7182 or 127.0.0.1:7182 and I get 127.0.0.1 refused to connect error.
I check in CLI:
$ telnet localhost 7182
Escape character is '^]'.
HTTP/1.0 400 Bad Request Content-Type: text/html Content-Length: 345
Connection: close Date: Sat, 22 Jul 2023 16:48:49 GMT Server:
HTTP Server
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
400 Bad Request 400 Bad
Request
Connection closed by foreign host.Trying 127.0.0.1... Connected to localhost.
It means that ssh forwarding is working. In CLI remote server opens the connection via localhost port 71 82. So the issue is local. I don't use any firewall or iptables or proxy on my Ubuntu 20.04.
It is the same for 3 browser FF, Chrome, Brave. I tried to clear cookies. Also when I try the same om similar but different host it works.
I will be very grateful for any clue! As this problem is very annoying.
Erorr in browser
$ sudo netstat -tulpn | grep 7182
tcp 0 0 127.0.0.1:7182 0.0.0.0:* LISTEN 34957/ssh
tcp6 0 0 ::1:7182 :::* LISTEN 34957/ssh
Also I've noticed that when I try it in browser the port number disappears in address line. But when I try some localhost port that has no listener the port number does not disappear.