Sample Header Ad - 728x90

Not working `<Location/>` tag in Apache Virtual host

1 vote
2 answers
448 views
I am trying to create Apache virtualhost that is closed for all IP addresses with exception of one IP address and two URLs that should be publicly accessible. ServerName example.com ServerAdmin hello@deriva.cz DocumentRoot "/var/www/example.com/app/webroot" Options FollowSymLinks Includes ExecCGI AllowOverride All ErrorDocument 403 "https://example.com/403.php " DirectoryIndex index.php Require all granted Require all granted Require ip 1.2.3.4 SSLProxyEngine on ProxyPreserveHost On ProxyRequests Off ProxyPass /api/ https://host.docker.internal:8443/api/ connectiontimeout=5 timeout=300 ProxyPassReverse /api/ https://host.docker.internal:8443/api/ SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf I've tried to change order of Location tags, but all requests are redirected to ErrorDocument directive value. URL /foo/bar/ is rewrited by .htaccess located in DocumentRoot (for testing purposes I tried to remove .htaccess with no effect). Apache version: - Server version: Apache/2.4.59 (Debian) - Server built: 2024-04-05T12:02:26 Apache runs in a Docker container, but it probably has no meaning for the problem. Q: What is wrong with the configuration?
Asked by jnemecz (161 rep)
May 24, 2024, 01:40 PM
Last activity: May 30, 2024, 07:46 AM