我正在尝试将一个Apache配置为我的Elasticsearch实例(REST服务)的代理。
到现在为止,我已使用LDAP配置了基本身份验证。
我们的目标是重定向请求
https://elasticsearch.example.de/kibana-int/dashboard/_search
到
http://127.0.0.1:9200/kibana-int-user1/dashboard/_search
这里user1
是LDAP登录名(从REMOTE_USER)。
我尝试了
<LocationMatch "^/kibana-int/(?<MOREINFOS>.*)$">
ProxyPassMatch "http://127.0.0.1:9200/kibana-int-%{REMOTE_USER}/%{ENV:MOREINFOS}"
ProxyPassReverse "http://127.0.0.1:9200/kibana-int-%{REMOTE_USER}/%{ENV:MOREINFOS}"
</LocationMatch>
通常可以这样做LocationMatch
吗?还是我必须先进行一些重写请求的URL重写和代理?
感谢您的阅读和帮助。
经过一段时间的研究,我终于找到了解决方案。
但是,不能ProxyPass*
使用RewriteRule
和[P]
标志:
<Location ~ "^/kibana-int/">
Include ldapauth.conf
RewriteEngine On
RewriteRule /kibana-int/(.*)$ http://127.0.0.1:9200/kibana-int-%{REMOTE_USER}/$1 [P]
</Location>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句