我有一个 AWS Elasticsearch 的反向代理。我在使用时遇到问题RedirectRule
:无论我尝试什么,我的 URL 都会被解释为文件。
SSLProxyEngine On
ProxyRequests On
ProxyPreserveHost On
RewriteEngine On
RewriteRule /test-api https://vpc-cls-elasticsearch-test-tmqu2s2mcftvsuqe.amazonaws.com [P]
ProxyPassReverse /test-api https://vpc-cls-elasticsearch-test-tmqu2s2mcftvsuqe.amazonaws.com
呼唤https://example.com/test-api总是返回此错误:
The requested URL /cls-api was not found on this server
在我的服务器上不存在实际文件的情况下,如何才能使其工作?
答案1
我能够用以下内容解决这个问题
<VirtualHost _default_:443>
SSLProxyEngine on
SSLEngine on
ProxyAddHeaders off
ProxyPreserveHost off
RewriteRule /test-api https://vpc-x-x-x-01-tmqu2s2mcftvsyg3mweduvu.example.amazonaws.com:443 [P]
ProxyPassReverse /test-api https://vpc-cls-elasticsearch-01-tmqu2s2mcftvsuqeyg3mweduvu.us-gov-west-1.es.amazonaws.com:443