Apache proxy returning 403 forbidden

apache-http-servercentos

I'm trying to set up a home page where I can redirect my requests to others servers with a proxy so I have a single point of entry. I used to have this setup working properly on a windows machine running WAMP. I made the switch to Apache on CentOS7 and since, I'm having this issue. Here's my landing page:

<VirtualHost *:443>
    ServerName myhost.duckdns.org
    DocumentRoot /var/www/html/panel

    SSLEngine on
    SSLCertificateKeyFile /etc/letsencrypt/live/myhost.duckdns.org/privkey.pem
    SSLCertificateFile /etc/letsencrypt/live/myhost.duckdns.org/cert.pem
    SSLCertificateChainFile /etc/letsencrypt/live/myhost.duckdns.org/chain.pem
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown


    <Directory /var/www/html/panel>
    Order deny,allow
    Deny from all
    Allow from myips
    AuthType Basic
    AuthName "Authorised Users Only"
    AuthUserFile .htpasswd
    Satisfy Any
    Require valid-user
    </Directory>

And here's the proxypass

<VirtualHost *:443>
ServerName sickbeard.my.to

    SSLEngine on
    SSLCertificateKeyFile /etc/letsencrypt/live/sickbeard.my.to/privkey.pem
    SSLCertificateFile /etc/letsencrypt/live/sickbeard.my.to/cert.pem
    SSLCertificateChainFile /etc/letsencrypt/live/sickbeard.my.to/chain.pem
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

    <Proxy *>
    Order deny,allow
    Deny from all
    Allow from myips
    AuthType Basic
    AuthName "Authorised Users Only"
    AuthUserFile .htpasswd
    Satisfy Any
    Require valid-user
    </Proxy>
    ProxyPass / http://192.168.0.170:8081/
    ProxyPassReverse / http://192.168.0.170:8081/
</VirtualHost>

I can reach the main page without problem and I can reach sickbeard using the IP or the hostname but using the hostname gives me the 403.

Best Answer

Found it! It was blocked by the mod_security module! I should've checked the logs first.

I disabled that module in httpd.conf. I read a bit on the subject and for what i'm doing, this module was clearly an overkil.

Related Question