好的,所以我有一点母马。
在计算机上我有三个用户,说user1
,user2
和user3
。每个用户分别在8384
/ 22000
、8385
/22001
和8386
/上运行同步和监听22002
。
对于每个用户,我都设置了一个带有反向代理的 Apache 虚拟主机。虚拟主机文件的内容是(比如user1
):
<VirtualHost *:80>
ServerName user1.syncthing.mydomain.com
ErrorDocument 404 /404.html
RewriteEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / "http://localhost:8384/"
ProxyPassReverse / "http://localhost:8384/"
<Proxy *>
Order deny,allow
Allow from localhost
</Proxy>
ErrorLog ${APACHE_LOG_DIR}/user1_syncthing_error.log
CustomLog ${APACHE_LOG_DIR}/user1_syncthing_access.log combined
RewriteCond %{SERVER_NAME} =user1.syncthing.mydomain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
我已验证在正确端口上为每个用户运行同步
$ sudo lsof -i -P -n | grep syncthing | grep LISTEN
syncthing 649 user2 12u IPv6 23903 0t0 TCP *:22001 (LISTEN)
syncthing 649 user2 17u IPv4 19216 0t0 TCP 127.0.0.1:8385 (LISTEN)
syncthing 656 user1 16u IPv6 14254 0t0 TCP *:22000 (LISTEN)
syncthing 656 user1 19u IPv4 23931 0t0 TCP 127.0.0.1:8384 (LISTEN)
syncthing 668 user3 13u IPv6 23921 0t0 TCP *:22002 (LISTEN)
syncthing 668 user3 19u IPv4 18427 0t0 TCP 127.0.0.1:8386 (LISTEN)
在adddition尝试连接user1.syncthing.mydomain.com
,user2.syncthing.mydomain.com
并user3.syncthing.mydomain.com
从远程计算机的所有把我送到正确的IP地址。
但!该设置仅适用于user1
!使用 telnet 检查服务器上的连接user2
并user3
告诉我
Trying <correct IP address>
telnet: Unable to connect to remote host: Connection refused
并从远程计算机告诉我(暂停后)
Trying <correct IP address>
telnet: Unable to connect to remote host: No route to host
我也尝试更改虚拟主机文件user3
以匹配,user1
但问题仍然存在。
这个设置在我大约一周前第一次设置时起作用,并且文件夹与当时设置的机器的同步仍然有效,我只是在进入配置 GUI 时遇到了麻烦。
我猜我出错的页面的实际服务有一些问题,但我正在脱发,试图弄清楚是什么。
这些问题是我是如何hairpinning -在主机条目添加的时候我胖手指的IP地址:user1.syncthing.mydomain.com
指向192.168.20.12(正确的),但user2.syncthing.mydomain.com
和user3.syncthing.mydomain.com
两个指着192.168.10.12(不正确)。
当我说 telnet 将转到问题描述中的正确地址时,我没有注意到10
/ 的20
区别!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句