I started a new server in a virtual machine, and I can access its homepage from the browser. I set up a docker container hosted on port 90 which I can also access. To link /app/
to localhost:90
I enabled the proxy
module and edited 000-default.conf
to the following configuration following the oficial documentation:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests off
<Proxy *>
ProxyPreserveHost Off <- I tried On
Require all granted
</Proxy>
ProxyPass /app/ http://localhost:90/ <- I tried without trailing slashes on both arguments and lines. (I get 500 response without them)
ProxyPassReverse /app/ http://localhost:90/
</VirtualHost>
When opening localhost/app
from the vm or the same route from outside I get 404 error. What could be wrong here?
apache2ctl -S
output:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
No errors on error log