Standortheader im Apache-Reverse-Proxy verarbeiten

Standortheader im Apache-Reverse-Proxy verarbeiten

Ich verwende Apache/2.4.29 (Ubuntu) und habe es als Reverse-Proxy-Server für den internen Webserver konfiguriert. Die Adresse meines Reverse-Proxy-Servers ist 10.0.0.1, die öffentlich zugänglich ist, und die Adresse meines internen Servers ist 192.168.1.15, ein privater Server. Die Konfigurationsdatei des virtuellen Hosts sieht wie folgt aus.

ServerName      web.example.com
ServerAlias     web.example.com
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://192.168.1.15/web/public/
ProxyPassReverse / http://192.168.1.15/web/public/
ProxyPassReverseCookiePath / /
<Location "/">
Order allow,deny
Allow from all
</Location>
ErrorLog ${APACHE_LOG_DIR}/web-error.log
CustomLog ${APACHE_LOG_DIR}/web-access.log combined

Erwartetes Ergebnis:http://web.example.comund Tatsächliches Ergebnis:http://web.example.com/web/public/

Wenn ich die URL curle... $curl -vhttp://web.example.com

Trying 10.0.0.1...
TCP_NODELAY set
Connected to web.example.com (10.0.0.1) port 80 (#0)
GET / HTTP/1.1
Host: web.example.com
User-Agent: curl/7.58.0
Accept: /
HTTP/1.1 302 Found
Date: Sun, 30 Aug 2020 13:28:09 GMT
Server: Apache/2.4.29 (Ubuntu)
Cache-Control: no-cache, private
Location: http://web.example.com/web/public/
Content-Length: 522
Content-Type: text/html; charset=UTF-8

verwandte Informationen