public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] [OT] Proxytunnel through nginx
Date: Sun, 19 Feb 2012 18:15:46 +0000	[thread overview]
Message-ID: <201202191815.55296.michaelkintzios@gmail.com> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 2239 bytes --]

Hi All,

I am trying to set up a reverse-proxy at my home to be able to by-pass 
restrictive firewalls that only allow http/https traffic.

So I configured nginx as a reverse-proxy to send connections to the sshd at the 
home server.  However, I fail to establish a connection.  The connection 
attempt errors out with:

$ ssh root@192.168.1.5
SSL enabled
Connected to XXX.XX.XXX.XX:443 (local proxy)

Tunneling to 192.168.1.5:22 (destination)
Communication with local proxy:
 -> CONNECT 192.168.1.5:22 HTTP/1.0
 -> Proxy-Connection: Keep-Alive
analyze_HTTP: readline failed: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host

where XXX is the public IP address of my server.

the proxy tunnel command is as follows:

 /usr/bin/proxytunnel -v -e -p XXX.XX.XXX.XX:443 -R user:'secretpasswd' -d 
192.168.1.5:22

The relevant nginx entries are as follows:
================================
    upstream tunnel {
        server 127.0.0.1:22;
        }

    server {                                
        listen       443;
        server_name  localhost;

        ssl                  on;
        ssl_certificate      certs/cert.pem;   
        ssl_certificate_key  certs/cert.key;
        ssl_session_timeout  5m;
        keepalive_timeout       70;

        location /  {
                auth_basic      "Restricted";
                auth_basic_user_file    .htpasswd_slug;
#               proxy_pass http://tunnel;
                proxy_pass http://127.0.0.1;
                proxy_buffering off;
                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;
        }
}
================================


The nginx error logs don't show anything, so I'm thinking there's something 
that the sshd does not like, but even when I increase the debug level in the 
sshd_config nothing shows up.  This means that the remote client never reaches 
as far as the sshd server (nginx and sshd are both running on the same host).

Any idea what causes this problem?

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2012-02-19 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 18:15 Mick [this message]
2012-02-22  7:14 ` [gentoo-user] Re: [OT] Proxytunnel through nginx Mick
2012-02-22 12:07 ` [gentoo-user] " Helmut Jarausch
2012-02-22 14:20   ` Mick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201202191815.55296.michaelkintzios@gmail.com \
    --to=michaelkintzios@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox