| #NameVirtualHost 127.0.0.1:{{ lava_srv_http_port }} |
| #<VirtualHost lava-server:{{ lava_srv_http_port }}> |
| <VirtualHost *:{{ lava_srv_http_port }}> |
| ServerAdmin webmaster@localhost |
| |
| Alias /static/ /usr/share/lava-server/static/ |
| Alias /tmp/ /var/lib/lava/dispatcher/tmp/ |
| Alias /favicon.ico /usr/share/lava-server/static/lava_server/images/logo.png |
| |
| # Let apache2 handle these URIs |
| ProxyPass /static ! |
| ProxyPass /tmp ! |
| ProxyPass /favicon.ico ! |
| # Send request to Gunicorn |
| ProxyPass / http://127.0.0.1:8000/ |
| ProxyPassReverse / http://127.0.0.1:8000/ |
| ProxyPreserveHost On |
| |
| <IfModule mod_headers.c> |
| # Specify the mime type for new font formats |
| AddType application/x-font-woff .woff |
| AddType application/x-font-woff2 .woff2 |
| # Add cache control headers |
| ExpiresActive On |
| ExpiresByType application/javascript "access plus 1 month" |
| ExpiresByType application/x-font-woff "access plus 1 month" |
| ExpiresByType application/x-font-woff2 "access plus 1 month" |
| ExpiresByType image/gif "access plus 1 month" |
| ExpiresByType image/png "access plus 1 month" |
| ExpiresByType text/css "access plus 1 month" |
| # Disable ETags are this is preventing most caching in (at least) firefox |
| Header unset ETag |
| FileETag none |
| </IfModule> |
| |
| # Allow serving media, static and other custom files |
| <Directory /usr/share/lava-server/static/lava_server/> |
| Options FollowSymLinks |
| AllowOverride None |
| Require all granted |
| </Directory> |
| |
| DocumentRoot /usr/share/lava-server/static/lava_server/ |
| |
| # Make exceptions for static and media. |
| # This allows apache to serve those and offload the application server |
| <Location /static> |
| SetHandler none |
| # Add browser caching. |
| ExpiresActive On |
| ExpiresDefault "access plus 1 month" |
| </Location> |
| |
| # images folder for lava-dispatcher tarballs |
| <Location /images/> |
| SetHandler none |
| </Location> |
| <Directory /var/lib/lava/dispatcher/tmp> |
| Options Indexes |
| Require all granted |
| AllowOverride None |
| </Directory> |
| |
| <Directory /usr/share/lava-server/static> |
| Require all granted |
| </Directory> |
| |
| LogLevel info |
| ErrorLog ${APACHE_LOG_DIR}/lava-server.log |
| CustomLog ${APACHE_LOG_DIR}/lava-server.log combined |
| </VirtualHost> |