'How can I block apache2 root path to a proxy? is it even possible?

So I am hosting an icecast server and I want to proxy ssl termination to icecast using apache2. I was using an nginx proxy to icecast which was perfect but there were some complications with nginx and php, so i have to use apache2.

so I am trying to achieve the same proxy as what I achieved in nginx but I simply cannot block the root path without blocking everything or it simply not working.

here is my virtualhost below, I have added some comments for some attempts (2 of about 100 attempts lol)

<VirtualHost *:8050>
        ServerAlias     *.mydomain.com

        SSLEngine on
        SSLCertificateFile      /etc/apache2/ssl/mydomain.com.pem

        ProxyPreserveHost On

        RewriteEngine On
        RewriteCond %{REQUEST_URI} ^/stats.xsl [NC]
        RewriteCond %{REQUEST_URI} ^/index.html [NC]
        # this doesnt work. I expect because of the Rewrite Rule below?
        #RewriteCond %{REQUEST_URI} ^/ [NC]
        RewriteRule .* - [F,L]

        # this doesnt work it blocks everything
        #<Location />
        #        Order Allow,Deny
        #        Deny from  all
        #</Location>

        ErrorLog ${APACHE_LOG_DIR}/mediaserverproxy-error.log
        CustomLog ${APACHE_LOG_DIR}/mediaserverproxy-access.log combined

        ProxyPass / http://localhost:80/
        ProxyPassReverse / http://localhost:80/

</VirtualHost>

Just to be clear I know you can do ssl in icecast but it reduces stability when sending icecast HUP signals for reloads.

Any help is massively apreciated



Solution 1:[1]

What is the expected outcome? That a request for / will return a 404 and any other request will serve that path with a 200?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guy Thouret