2014-09-24 54 views
1

我想配置一个Apache作为我的elasticsearch实例(REST服务)的代理。Apache代理配置与变量

直到现在,我使用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做到这一点tryed呢? 或者我必须首先做一些URL重写和代理重写请求?

感谢您的阅读和帮助。

回答

0

经过又一次的研究,我终于找到了解决办法。

这是不可能的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>