I want to setup an apache 2.4 virtualhost to serve 'physical' files that exist in the directory 'var/www/html' (like robots.txt for example).
If the requested URI is not an existing file, the reverse proxy rules should be used.
I read about conditional ProxyPassing like so
<If "! -f %{REQUEST_FILENAME}">
#ProxyPassReverseCookiePath / /author
ProxyPassReverseCookieDomain localhost mywebsite.com
#ProxyPass / ajp://localhost:7009/
#ProxyPassReverse / ajp://localhost:7009/
ProxyPass / http://localhost:7080/
ProxyPassReverse / http://localhost:7080/
</If>
and after those lines I'd put my location directives.
But it does not work, instead it's saying AH00526: Syntax error on line 45 of /etc/apache2/sites-enabled/000-default.conf:
ProxyPass cannot occur within <If> section
I read about this here: https://serverfault.com/a/655873/149187 (not the accepted answer, but 3 upvotes).
How can I use the if-tag? Or is there a better way to achieve what I'm looking for? Thanks for pointing me in the right direction!