I created the sites-available and site-enabled folders, I added the site.domain.com.conf file with a virtualhost in my domain site.domain.com to do reverse proxy in a Nuxt node.js application, which is running successfully on localhost:3000. I made the following configuration:
<VirtualHost *:80> ServerName site.domain.com ServerAlias www.site.domain.com DocumentRoot /var/www/html ErrorLog /home/user01/site.domain.com/error.log CustomLog /home/user01/site.domain.com/access.log combined ProxyRequests off <Proxy *> Require all granted </Proxy> ProxyPreserveHost on ProxyPass / http://localhost:3000/ retry=1 acquire=3000 timeout=3000 keepalive=off ProxyPassReverse / http://localhost:3000/ ProxyTimeout 3000 ProxyVia full </VirtualHost>
I also added the following line in the httpd.conf file
And after restarting apache it created the requests.log and access.log files in the folder I configured in the ErrorLog and CustomLog parameters, so the configuration was read by apache.
When accessing the domain site.domain.com it does not point the requests to localhost: 3000, it just displays the directory files in the browser, what am I doing wrong?
- CentOS 6.9
- Apache 2.4.39
- Enabled modules: proxy_module, proxy_http_module, lbmethod_byrequests_module, proxy_balancer_module
This is the result of the apachectl -S command:
port 80 namevhost site.domain.com (/etc/apache2/conf/httpd.conf:761) alias www.site.domain.com port 443 namevhost site.domain.com (/etc/apache2/conf/httpd.conf:1881) alias www.site.domain.com *:80 site.domain.com (/etc/apache2/sites-enabled/site.domain.com.conf:1)
Notice that my virtual host configuration was added to the end, but still shows two other default settings, is it normal?