我无法让Rocket.Chat在Apache的子文件夹中正常运行。
在example.conf中具有此配置:
<VirtualHost *:80>
....
# Redirect Requests to SSL
Redirect permanent / https://example.com
....
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
....
ServerName example.com
ServerAlias example.com
DocumentRoot /var/www/html/example/
....
<Location /chat>
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /var/www/html/example/(.*) ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /var/www/html/example/(.*) http://localhost:3000/$1 [P,L]
ProxyPassReverse http://localhost:3000
</Location>
....
</VirtualHost>
</IfModule>
rocketchat.service中的此配置:
MONGO_URL=mongodb://localhost:27017/rocketchat
ROOT_URL=http://example.com:3000
PORT=3000
我得到了一个Rocket.Chat页面(https://example.com/chat),但是没有任何作用,并且我的控制台中有这个
GET https://example.com/1b0d8599411c1e4f1919893c25d81fc7ac20d65b.css?meteor_css_resource=true net::ERR_ABORTED 404 (Not Found)
chat:200 GET https://example.com/theme.css?1807b422d007328786a00d34e6c63ee6022dd2b3 net::ERR_ABORTED 404 (Not Found)
chat:1138 GET https://example.com/6a61dfe05b23fcb695eea8e15f15c745e2623326.js?meteor_js_resource=true net::ERR_ABORTED 404 (Not Found)
如您所见,URL中没有子文件夹“ chat/"。
当我放入火箭聊天服务
时ROOT_URL=https://example.com/chat/ node main.js
我得到:
503 Service Unavailable
然后在Apache错误日志中:
Fri Nov 09 16:21:16.460766 2018] [proxy_http:error] [pid 5999] [client 72.56.75.46:52090] AH01114: HTTP: failed to make connection to backend: localhost
我迷路了,我不明白自己在做什么错。