Apache Reverse Proxy不使用特殊的charcater重定向URL

时间:2017-02-08 11:51:57

标签: apache elasticsearch reverse-proxy kibana mod-proxy

我已经使用apache mod_proxy设置了反向代理,它对我设置的所有网址都运行良好,除了一些包含特殊字符的URL(特别是*)

 我尝试编码特殊字符,以及使用nocanon标志。但似乎都没有效果。我基本上试图在RP后面运行kibana,并且需要消除/替换Kibana用来查询elasticsearch的特殊字符(use,而不是*)。以下是我的反向代理配置 -

<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off

# works fine
ProxyPass /kibana http://10.19.225.20:5601/app/kibana
ProxyPassReverse /kibana http://10.19.225.20:5601/app/kibana

# works fine
ProxyPass /elasticsearch http://10.19.225.20:5601/elasticsearch
ProxyPassReverse /elasticsearch http://10.19.225.20:5601/elasticsearch

# Doesn't work
#ProxyPass /elasticsearch/.kibana/_mapping/*/field/_source http://10.19.225.20:5601/elasticsearch/%2Ekibana/%5Fmapping/%2A/
#ProxyPassReverse /elasticsearch/.kibana/_mapping/*/field/_source http://10.19.225.20:5601/elasticsearch/%2Ekibana/%5Fmapping/%2A/

# Doesn't work
#ProxyPass /elasticsearch/%2Ekibana/%5Fmapping/%2A/ http://10.19.225.20:5601/elasticsearch/%2Ekibana/%5Fmapping/index-pattern%2Csearch%2Cconfig/ nocanon
#ProxyPassReverse /elasticsearch/%2Ekibana/%5Fmapping/%2A/ http://10.19.225.20:5601/elasticsearch/%2Ekibana/%5Fmapping/index-pattern%2Csearch%2Cconfig/

# Doesn't work, just a test to use , char in target
#ProxyPass /elasticsearch/.kibana/index-pattern http://10.19.225.20:5601/elasticsearch/.kibana,kib2/index-pattern nocanon
#ProxyPassReverse /elasticsearch/.kibana/index-pattern http://10.19.225.20:5601/elasticsearch/.kibana,kib2/index-pattern

#RewriteEngine on
#RewriteRule ^/index-pattern /_search?fields=

# Doesn't work
ProxyPass /elasticsearch/kibana/%5Fmapping/%2A http://10.19.225.20:5601/elasticsearch/kibana/%5Fmapping/index%2Dpattern%2Csearch%2Cconfig nocanon
ProxyPassReverse /elasticsearch/kibana/%5Fmapping/%2A http://10.19.225.20:5601/elasticsearch/kibana/%5Fmapping/index%2Dpattern%2Csearch%2Cconfig

# Doesn't work
#ProxyPass /elasticsearch/.kibana/_mapping/* http://10.19.225.20:5601/elasticsearch/.kibana/_mapping/index-pattern,search,config
#ProxyPassReverse /elasticsearch/.kibana/_mapping/* http://10.19.225.20:5601/elasticsearch/.kibana/_mapping/index-pattern,search,config

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
</VirtualHost>

在评论的行中,我尝试了各种各样的东西,但似乎都没有。具体来说,我正在尝试用http://10.19.225.20/elasticsearch/kibana/_mapping/*/field/source?=some_number替换Kibana生成的网址“http://10.19.225.20/elasticsearch/.kibana/_mapping/index-pattern,search,config/field/source?=some_number”我认为我需要一些网址重写规则,此外还有RP配置,但不知道该怎么做因为我之前没有使用过重写规则。

任何帮助/建议都将不胜感激。

0 个答案:

没有答案