2

nginxをWebサーバーとして使用して、http接続でsshをセットアップしようとしています。実用的な例はないようです。proxytunnel は、私が ssh の http ラッパーに使用しているもので、これまでのところ nginx ではうまく機能しないようです。戻り値: laptop ~$ proxytunnel -v -p ssh.example.com:80 -d localhost:22 -H "User-Agent: Mozilla/4.0 (互換性あり; MSIE 5.0; Windows NT 5.1; .NET CLR 1.1.4322) \n" ローカル プロキシ ssh.example.com は 1.2.3.4 に解決されます ssh.example.com に接続:80 (ローカル プロキシ)

Tunneling to localhost:22 (destination)
Communication with local proxy:
 -> CONNECT localhost:60022 HTTP/1.0
 -> Proxy-Connection: Keep-Alive
 -> User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.1; .NET CLR 1.1.4322)\n
 <- <html>
 <- <head><title>400 Bad Request</title></head>
 <- <body bgcolor="white">
 <- <center><h1>400 Bad Request</h1></center>
 <- <hr><center>nginx/0.7.67</center>
 <- </body>
 <- </html>
analyze_HTTP: readline failed: Connection closed by remote host

ssh を使用すると、以下が追加されます。ssh_exchange_identification: Connection closed by remote host

私の設定は次のとおりです。nginx:

~デフォルト: nginx.conf

sshトンネル:

upstream tunnel {
server localhost:22;
}
server {
listen 80;
server_name ssh.*;
location / {
proxy_pass http://tunnel;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
}

ssh: default+gatewayports=yes+キー認証のみ

誰が何が間違っているかについて何か考えがありますか? 私のgooglefuはこれで私を失敗させています:/

4

0 に答える 0