On 05-Jul-17 06:14, Alexander Klotz wrote:
Hi Abhilash & everybody,
thanks for your help! We got the configuration working now, see below
- proxy modules have to be loaded here to make it work.
Regards, Alex
<VirtualHost *:443> ServerAdmin webmaster@localhost ServerName mailman.example.org Alias /static /opt/mailman/web/static Alias /favicon.ico /opt/mailman/web/static/hyperkitty/img/favicon.ico ProxyPassMatch ^/static/* ! ProxyPass / http://172.19.199.3:8000/ ProxyPassReverse / http://172.19.199.3:8000/ <Directory /> Allow from all Require all granted </Directory> <Directory /opt/mailman/web/static/hyperkitty/img/> Allow from all Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined # ssl config here ... </VirtualHost>
I'm glad you got your server working. Thank you for posting your configuration.
I see one problem with what you posted:
You probably don't mean "ProxyPassMatch ^/static/* !", but rather "ProxyPassMatch ^/static/.* !", although "ProxyPassMatch ^/static/ ! " would also be correct. (You are missing a period before the asterisk.)
The first argument to ProxyPassMatch is a regular expression: "/*" means "zero or more '/'", but you want '/' followed by anything. ".*" means "zero or more <any character>". (Including the '/' prevents something like '/staticlibrary' from matching.) But since you don't try to match anything after the '/', the '.*' is unnecessary. (You'd need it for something like "^/static/.*\.(?:css|png|js)$", where you want to match some arbitrary text followed by something definite.)
Apache doesn't do a good job of documenting its regular expression syntax, so here are a couple of notes:
Apache uses the Perl Compatible Regular Expression library (with a couple of extensions). See http://www.pcre.org for full documentation; the regexps are almost exactly Perl, which is documented here: http://perldoc.perl.org/5.10.1/perlre.html. The differences are documented here: http://www.pcre.org/current/doc/html/pcre2compat.html - but unless you are an advanced regex user, you're unlikely to encounter them. The differences are with respect to Perl V5.10 (the current version of Perl is 5.26).
One of the extensions is !, which inverts the match criteria. Apache does document that.
The configuration posted is for Apache 2.4 +.