Search code examples
network-programmingapache2reverse-proxyvirtualhost

Issue with Apache2 Reverse proxy


I need to create a reverse proxy in apache2 for an icecast server, but with another virtualhost as a simple website

I managed to create the reverse proxy, using this configuration in apache Virtualhost

<VirtualHost 100.100.100.100:80>
    ServerName icecast.xxx.com
    ProxyPass / http://localhost:8000/
</VirtualHost>

100.100.100.100 is the ip of the server, and xxx.com is the domain So when i type in my browser icecast.xxx.com the icecast admin panel (on 8000 port) show up

Then i have added another virtualhost

<VirtualHost *:80>
        ServerName xxx.com
        ServerAlias www.xxx.com
        ServerAdmin MY_EMAIL
        DocumentRoot /var/www/site/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I have enabled him with sudo a2ensite NAME_OF_THE_CONFIG_FILE

But when I go to the ip of the VPS or to xxx.com/www.xxx.com the icecast2 admin panel show up!

I don't know how to solve this, I maybe think that the error is in the line


Solution

  • I finally managed to solve the issue, simply in the reverse proxy virtualhost, instead of <VirtualHost 100.100.100.100:80> I need to put <VirtualHost *:80>