服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

通过ssh隧道和nginx代理访问服务器

我是nginx的新手。 我已经用nginxinheritance了一个function齐全的configuration好的Ubuntu服务器,并且希望另外调整它来支持下面描述的有点奇怪的configuration。 基本信息。 我的Ubuntu服务器(我们将其命名为server.corp.com)运行在内部公司networking中。 它拥有Gerrit和Jenkins,每个都有www接口,在自己的端口(8081和8082)上侦听,nginx代理请求到相应的locations 。 例如http://server.corp.com/gerrit的请求被代理到http://server.corp.com:8081不幸的是,我现在无法显示nginxconfiguration,因为我正在家里写这个问题。 我记得它包含了带有proxy_pass子句的行。 现在,这是奇怪的configuration。 server.corp.com, ports 80, 22 and 29418 <–> other Linux <–> Windows Other Linux和Windows PC也属于公司networking(很大)。 Other Linux可以通过端口80,22和29418连接到我的服务器。其他端口被防火墙阻止,我不会受到影响。 Windows PC可以使用SSH连接到Other Linux ,并且可能还有其他端口和协议。 我在Other Linux上既没有login也没有超级用户权限。 我的同事WindowsPC用户已经成功地在端口29418上使用Putty和SSH隧道连接到我们的Gerrit(它也监听端口29418)。 相应的隧道是localhost:29418 -> server.corp.com:29418 。 我的目标是让我的同事在server.corp.com访问Gerrit和Jenkins的www接口。 我可以指示他build立一个或多个SSH隧道到我的服务器。 不过,我想,这也需要一些调整nginx,因为简单的SSH隧道localhost:80 -> server:80不起作用。 Chrome在尝试连接到本地主机时抱怨SSL连接超时:80。 更新2:我试图在我的电脑上build立这个设置(Windows也是如此),并使用Gi​​t发行版中的wget。 我还创build了一个实验的位置。 这里是nginxconfiguration的相关部分(我希望) # file nginx.conf include /etc/nginx/conf.d/*.conf; # … # file conf.d/tunnel.conf […]