简体   繁体   中英

Apache reverse proxy - rewrite and Substitute returning answer

We have reverse proxy server which use rewrite rule to redirect one address to another.

When redirection is working, we get back an answer from that site (google) as a txt page.

Now, we wish to Substitute few words in that page and direct it to the source server that asked for it.

Our configuration looks like this:

ProxyRequests Off
RewriteEngine on

RewriteRule ^/books\.google\.com(.*) https://books.google.com/$1
Substitute "s/thumbnail_url/test/ni"

We do get the page back from google, but Substitute of words in the page is not working.

Hoping someone can answer it.

Thanks

Found the way to do so, by adding the following lines:

SSLProxyEngine On RequestHeader set Front-End-Https "On"

Substitute "s/thumbnail_url/test/ni" [P]

Cause [P] will made the all query to work with https (as rewrite rule defined) and two first lines support SSL on apache proxy.

Lavi

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM