I'm trying to serve custom html 401 on the Apache webserver, not through a proxy.

The files are under /var/www/html/401 in the central webserver, but no matter what, apache wants to serve the proxied root, /. So it is looking for /401/index.index in the proxied resource and obviously not working.

Everything I have read says that if I do ProxyPass /401 ! I won't have any problems, it will serve it locally, but it's still trying to proxy it... it looks like this isn't possible to do on Apache 2.4?

<VirtualHost *:*>
    ServerName my-subdomain.my-domain.com

    ProxyErrorOverride On
    ProxyPass /401 !
    ProxyPass /401/ !

    <Location />
        #DO NOT proxy the /401/index.html file...
        RewriteCond %{REQUEST_URI} !^/401/index.html [NC]
        RewriteRule ^/(.*) http://my-server.my-domain.com/$1 [P]
        ProxyPassReverse   http://my-server.my-domain.com


DocumentRoot "/var/www/html"
ErrorDocument 401 /401/index.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.