服务器1运行Apache 代理和网络服务器 tomcat领域:example.com/app1
。服务器2运行刚刚网络服务器 tomcat example.com/app2
。我想重定向example.com/
到example.com/app1
app2 服务器,而不是重定向,只是停留在example.com/app2
。还需要将所有页面从 http 重定向到 https。app1 和 app2 服务器之间有些东西无法正常通信 - 我看到错误 500。
**hhtpd.conf on Server1:**
Listen 80
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RedirectMatch "^/$" "https://example.com/app1/"
**ssl.conf on Server1:**
<VirtualHost *:443>
ServerName example.com
SSLEngine on
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
<Proxy *>
Require all granted
</Proxy>
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /app1 http://localhost:8080/app1
ProxyPassReverse /app1 http://localhost:8080/app1
ProxyPass /app2 http://192.168.11.8:8090/app2
ProxyPassReverse /app2 http://192.168.11.8:8090/app2
我可以将 RewriteEngine 与反向代理一起使用吗?