<VirtualHost *:80>
ServerName countdown.opensuse.org
ServerAlias counter.opensuse.org
UseCanonicalName Off
AADefaultHatName vhost_countdown
DocumentRoot /srv/www/countdown.opensuse.org/public
<Directory /srv/www/countdown.opensuse.org/public>
Require all granted
Options +FollowSymlinks
</Directory>
<Location />
Options Multiviews FollowSymLinks IncludesNoExec
DirectoryIndex medium
</Location>
# Use language detection only if "whatever.png" gets requested, but not if "whatever.xy.png" gets requested.
# This ensures that "whatever.xy.png" always gets delivered, even if it doesn't match the browser's Accept-Language header.
<LocationMatch ^/[^.]*\.png$>
LanguagePriority en
{% for lang in pillar['profile']['countdown']['languages']|sort %}
AddLanguage {{lang}} .{{lang}}.png
{%- endfor %}
</LocationMatch>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.png/?$ $1
RewriteRule ^/?((small|medium|large|wide)-nolabel)/?$ /$1 [PT]
RewriteRule ^/?((small|medium|large|wide)-label)/?$ /$1 [PT]
RewriteRule ^/?(|small|medium|large|wide)/?$ /$1 [PT]
RedirectTemp /goto/ https://en.opensuse.org/{{ pillar['profile']['countdown']['redirect_target'] }}?pk_campaign=counter
RedirectTemp /link/ https://en.opensuse.org/{{ pillar['profile']['countdown']['redirect_target'] }}?pk_campaign=counter
RedirectTemp /redirect/ https://en.opensuse.org/{{ pillar['profile']['countdown']['redirect_target'] }}?pk_campaign=counter
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" combinedproxy
CustomLog "/var/log/apache2/countdown-access_log" combinedproxy
</VirtualHost>
# vim:ft=apache