我将apache 2.4(docker)设置为反向代理,以将不同的子域分配给不同的docker服务。我使用Redirect
指令将http请求重定向到https。但是,不应将一个特定的URL路径(域后面的部分)确定为https,而应将其与特定目录中的文件一起使用。我正在尝试使用Alias
指令来完成此操作,该指令不起作用。
我假设Redirect
覆盖Alias
。真的吗?
如果是这种情况,我怎么能实现我的目标?
<VirtualHost *:80>
ServerName service.example.com
Alias /exception/ /var/www/exception
Redirect permanent / https://service.example.com/
</VirtualHost>
我希望这能奏效,但不能。
答案 0 :(得分:2)
首先,在处理别名之前先处理所有重定向,然后 因此,与Redirect或RedirectMatch匹配的请求将 从未应用过别名。其次,别名和重定向是 按照它们在配置文件中出现的顺序进行处理, 首先是比赛。
要确保$ pylint decorator.py
No config file found, using default configuration
************* Module decorator
C: 7, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 15, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 1, 0: Missing module docstring (missing-docstring)
C: 4, 0: Missing function docstring (missing-docstring)
C: 6, 4: Missing function docstring (missing-docstring)
C: 14, 0: Missing function docstring (missing-docstring)
不匹配,请使用/exception/
,它允许使用正则表达式模式:
RedirectMatch