Warum funktioniert die Übersetzung der Anker-HREF-Attribute bei meinem Apache-Reverse-Proxy beim Zurücksenden an den Client nicht?

Warum funktioniert die Übersetzung der Anker-HREF-Attribute bei meinem Apache-Reverse-Proxy beim Zurücksenden an den Client nicht?

Ich habe

# For blog
LoadModule proxy_html_module libexec/mod_proxy_html.so
LoadModule ssl_module libexec/mod_ssl.so
LoadModule xml2enc_module libexec/mod_xml2enc.so
SSLProxyEngine on
ProxyRequests off
ProxyPass /blog https://xxxx.wordpress.com
ProxyPassReverse /blog https://xxxx.wordpress.com
ProxyHTMLEnable On
ProxyHTMLURLMap https://xxxx.wordpress.com /blog
<Location /blog>
  ProxyPassReverse /
  ProxyHTMLEnable On
  ProxyHTMLURLMap / /blog
  RequestHeader    unset  Accept-Encoding
  #LogLevel proxy:debug
</Location>

Befolgen Sie diese Anleitungen:

https://devcenter.heroku.com/articles/custom-php-settings#using-a-custom-application-level-apache-configuration

http://www.apachetutor.org/admin/reverseproxies

https://httpd.apache.org/docs/trunk/mod/mod_proxy.html

Wenn ich die URL besuchehttp://www.xxxx.com/blog/es ersetzt keine Ankerlinkshttps://xxxx.wordpress.com/2015/09/16/hallo-welt/mit /blog.

Es funktioniert lokal, aber nicht in der Produktion.

Hier ist ein Beispiel für das HTML, das durch den Proxy geht und im Browser angezeigt wird:

<h1 class="entry-title">
  <a href="https://xxxx.wordpress.com/2015/09/16/hello-world/" rel="bookmark">Hello world!</a></h1>

Ich habe auch einen anderen Blog-Host (HostGator) anstelle von Wordpress.com verwendet, aber es funktioniert immer noch nicht. (Nicht, dass das wichtig wäre.)

Apache 2.4.16, Produktion: 2.4.10 (?)

Antwort1

Die Links im Antworttext können nicht mit Proxy-Referenz aktualisiert werden, es sei denn, der Zielhost verfügt über eine Funktion zum Zurückgeben erwarteter URLs oder Sie müssen die Links im Antworttext explizit durch zusätzlichen Code verwalten. Mehr Details..

Wenn es in der Entwicklung funktioniert, bedeutet das, dass es eine solche Konfiguration gibt, die in der Produktion fehlt.

verwandte Informationen