首页 > 解决方案 > rsync TLS 代理与 Apache:“rsync:服务器发送 'HTTP/1.1 400 Bad Request' 而不是问候”

问题描述

man rsyncd.conf说:

如果您将 rsync 放在 SSL 代理后面,您也可以使用 SSL/TLS 加密。

SSL/TLS 守护程序设置 当设置 rsync 守护程序以通过 SSL/TLS 访问时,您需要配置代理(例如 haproxy 或 nginx)作为处理加密的前端。

  • 您应该限制对 backend-rsyncd 端口的访问,只允许代理连接。如果它与代理在同一主机上,那么将其配置为仅在 localhost 上侦听是个好主意。

  • 如果您的代理支持发送该信息,您应该考虑打开代理协议参数。下面的示例假定已启用此功能。

我尝试在 Apache 上设置一个ProxyPass(反向代理)来监听端口 873(标准 rsync 端口)并转发到我在端口 874 上运行的本地 rsync 实例;但是, rsync 给出:

rsync: server sent "HTTP/1.1 400 Bad Request" rather than greeting

rsync 文档给出了一个 nginx 配置示例:

An example nginx proxy setup is as follows:

stream {
   server {
       listen 874 ssl;
       listen [::]:874 ssl;

       ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;
       ssl_certificate_key /etc/letsencrypt/example.com/privkey.pem;

       proxy_pass localhost:873;
       proxy_protocol on; # Requires "proxy protocol = true"
       proxy_timeout 1m;
       proxy_connect_timeout 5s;
   }
}

也许我没有正确地解释和翻译到 Apache。这个 nginx 配置似乎侦听端口 874 并转发到 873。(我认为我正在做相反的事情。)Apache 似乎没有类似的proxy_protocol on选项,或者是吗?我已经尝试过proxy protocol = true,并且= false在我的/etc/rsyncd.conf. Rsync 请求以一种方式超时,而另一种则给出“而不是问候”错误。

标签: apachesslproxyrsync

解决方案


推荐阅读