
Estoy usando Apache/2.4.29 (Ubuntu) y lo configuré como servidor proxy inverso para el servidor web interno. La dirección de mi servidor proxy inverso es 10.0.0.1, que está expuesta al público, y la dirección de mi servidor interno es 192.168.1.15, que es un servidor privado. El archivo de configuración del host virtual es el siguiente.
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
Resultado Esperado:http://web.ejemplo.comy resultado real:http://web.ejemplo.com/web/public/
Cuando enrollo la URL... $curl -vhttp://web.ejemplo.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