我想通过端口80上的子域使端口22上的ssh服务器可用。
我认为应该是这样的:
server {
listen ssh.domain.tld:80;
server_name ssh.domain.tld;
location / {
proxy_pass http://localhost:22;
}
}
但它不起作用。 nginx将接受此操作并从此配置开始,但我只从ssh.domain.tld:80
获得空响应。
我错过了什么?
答案 0 :(得分:3)
您应该使用sslh。
将nginx配置为在80以外的其他端口上运行,比如800,然后配置sslh以将网络流量重定向到/etc/default/sslh.conf
文件中的该端口。
此设置可能需要15分钟。或更少。
答案 1 :(得分:2)
由于Nginx版本1.9.0,NGINX支持ngx_stream_core_module模块,因此应使用--with-stream启用它。启用流模块时,可以使用ssh protocol tcp proxy
stream {
upstream ssh {
server localhost:22;
}
server {
listen 80;
proxy_pass ssh;
} }
https://www.nginx.com/resources/admin-guide/tcp-load-balancing/
答案 2 :(得分:0)
基本上你看错了地方:
A
和/或AAAA
记录将ssh.domain.tld
链接到您的ssh服务器的ip-adres
< / LI>
man sshd_config
特别是ListenAddress
和Port
指令)