我需要你的帮助。我在将反向代理重写为 https 时遇到了问题:
我有一个在 tomcat 上运行的 alfresco 应用程序,作为前端和 Apache 服务器 - 它的站点启用看起来像这样:
<VirtualHost *:80>
ServerName alfresco
JkMount /* ajp13_worker
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature Off
</VirtualHost>
我还在另一台机器上运行了一个反向代理服务器,我希望它将查询重写为 https。它的站点启用如下所示:
<VirtualHost 192.168.251.50:80>
ServerName alfresco
DocumentRoot /var/www/
RewriteEngine on
RewriteRule (.*) https://alfresco/ [R]
LogLevel warn
ErrorLog /var/log/apache2/alfresco-80-error.log
CustomLog /var/log/apache2/alfresco-80-access.log combined
ServerSignature Off
</VirtualHost>
<VirtualHost 192.168.251.50:443>
ServerName alfresco
DocumentRoot /var/www/
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/ssl/certs/alfresco.pem
SSLCertificateKeyFile /etc/ssl/private/alfresco.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /alfresco http://192.168.251.50:8080/alfresco
ProxyPassReverse /alfresco http://192.168.251.50:8080/alfresco
LogLevel warn
ErrorLog /var/log/apache2/alfresco-443-error.log
CustomLog /var/log/apache2/alfresco-443-access.log combined
ServerSignature Off
</VirtualHost>
现在,ProxyPass 可以工作了,当我通过浏览器访问 alfresco/alfrsco 时,应用程序会打开,但重写为 https 不起作用。
请帮忙。
问候
当我访问 192.168.251.50 时,Tomcat 配置页面显示。当我访问 192.268.251.50:8080 时 - 与上面相同 当我访问 192.168.251.50:8080/alfresco 时 - alfresco 应用页面显示应用 当我访问 alfresco/alfresco 时 - 与上面相同 当我访问https://alfresco或者https://alfresco我连接服务器时出错