我正在设置一个带有一个代理和两个后端服务器的测试环境。
我想像这样重定向:
example.com/app1/ -> apache_1
example.com/app2/ -> apache_2
example.com and all the rest to apache_1
我已经有了使用此配置的前两个重定向:
<Location /app1/>
ProxyPass http://apache_1/
ProxyPassReverse http://apache_1/
Order allow,deny
Allow from all
<
我使用HaProxy来平衡传入请求的负载,并进行基于子域的重定向。现在我想让所有传入的请求都强制使用HTTPS,并带有查询参数。
例如:-
"Bla“
应重定向至:-
"Bla“
我知道我可以用Apache做这样的重定向:
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
#RewriteRule ^/