gpt4 book ai didi

apache - 同一路径的多个 Apache Location 指令

转载 作者:行者123 更新时间:2023-12-05 04:18:31 24 4
gpt4 key购买 nike

我有一个 Web 应用程序当前在两个 HTTPS 端口上提供服务 - 比方说 4438443。该应用程序有一个 Apache HTTP 服务器作为前端,我遇到了麻烦设置 Apache 配置以排除其中一个端口上的某些路径。我的配置在 Apache

中设置如下
<Location /MyApp>
AuthType SOME_AUTH_MODULE
require user valid-user
</Location>

<Location ~ "/MyApp/(Login.html|Welcome.html)">
Satisfy Any
Allow from all
AuthType None
Require all granted
</Location>

我在 Apache 中设置了虚拟主机,如下所示

<VirtualHost _default_:443>
DocumentRoot /path/to/my/files
Servername www.example.com:443
Other details go here

</VirtualHost>

<VirtualHost _default_:8443>
DocumentRoot /path/to/my/files
Servername www.example.com:8443
Other details go here

</VirtualHost>

考虑到 Location 指令不接受 hostport 信息,上述配置的预期问题是什么? Location 指令是使用第一个匹配的条目,还是使用其中一个匹配的条目

了解 Shibboleth 的人的更多详细信息

第一个 Location 条目允许用户在 SSO(单点登录)环境中访问应用程序。第二个条目旨在允许用户在不通过 SSO 的情况下访问不同端口 (8443) 上的同一虚拟主机。我们看到的是,请求 header 在处理链的末端丢失了。当我删除第二个位置条目时,一切正常。

最佳答案

/Location 指令放在要保护的 vhost 指令中。

<VirtualHost _default_:443>
DocumentRoot /path/to/my/files
Servername www.example.com:443
<Location /MyApp>
AuthType SOME_AUTH_MODULE
require user valid-user
</Location>
Other details go here

</VirtualHost>

<VirtualHost _default_:8443>
DocumentRoot /path/to/my/files
Servername www.example.com:8443
Other details go here

</VirtualHost>

关于apache - 同一路径的多个 Apache Location 指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13296701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com