ProxyPassReverse未显示所需的位置

时间:2019-03-11 22:10:47

标签: html apache

我已经在服务器上安装了RocketChat,并设置了一个apache2虚拟主机,以使用ProxyPassReverse在访问rc.domain.com时显示访问者本地主机:3000。
唯一的问题是,无论您做什么,它都不会重定向您并显示“禁止,您无权访问此服务器上的/”。
我的etc / apache2 / sites-enabled / website.conf文件:

<VirtualHost *:443>

ServerAdmin support@domain.com
ServerName rc.domain.com
ErrorLog /var/log/rc.domain.com_error.log
TransferLog /var/log/rc.domain.com_access.log
LogLevel info
SSLEngine On
SSLCertificateFile /etc/ssl/certs/domain.com.crt
SSLCertificateKeyFile /etc/ssl/private/domain.com.key
SSLCertificateChainFile /etc/ssl/certs/domain.com.crt

<Location />
        Order allow,deny
        Allow from all
</Location>

RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*)           http://localhost:3000/$1 [P,L]

ProxyPassReverse / http://localhost:3000/
</VirtualHost>

我正在使用Cloudflare的“始终使用HTTPS”及其自动网站加密,如果有帮助的话。 Apache在端口80上运行了另一个虚拟主机,该虚拟主机具有第一个虚拟主机的子域。这是ErrorLog的输出:

[Mon Mar 11 22:28:53.305103 2019] [ssl:info] [pid 1224] AH02568: Certificate and private key rc.example.com:443:0 configured from /etc/ssl/certs/example.com.crt and /etc/ssl/private/example.com.key 
[Mon Mar 11 22:28:53.722851 2019] [ssl:info] [pid 1225] AH01914: Configuring server rc.example.com:443 for SSL protocol

Rocketchat没有记录任何可见错误。
/var/log/apache2/access.log:

[my ip] - - [11/Mar/2019:23:01:33 +0000] "GET / HTTP/1.1" 403 505 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0"

编辑:已修复!对于将来遇到此问题的任何人:尝试将端口设置为80而不是443,这对我来说是固定的。

0 个答案:

没有答案