<VirtualHost *:80>
ServerName translations.scummvm.org
Redirect permanent / https://translations.scummvm.org/
</VirtualHost>

<VirtualHost *:443>
ServerName translations.scummvm.org
ServerAdmin webmaster@scummvm.org
DocumentRoot /var/www/weblate

ErrorLog ${APACHE_LOG_DIR}/translations_error.log
CustomLog ${APACHE_LOG_DIR}/translations_access.log combined

# ---- WEBLATE SETUP ----
# -----------------------

Alias /robots.txt /var/www/weblate/static/robots.txt
Alias /favicon.ico /var/www/weblate/static/favicon.ico

Alias /static/ /var/www/weblate/static/
<Directory /var/www/weblate/static/>
  Require all granted
</Directory>

Alias /media/ /var/www/weblate/media/
<Directory /var/www/weblate/media/>
  Require all granted
</Directory>

#WSGIPythonPath /home/weblate/weblate-env/lib/python3.7/site-packages/weblate:/home/weblate/weblate-env/lib/python3.7/site-packages
#WSGIDaemonProcess translations.scummvm.org python-path=/home/weblate/weblate-env/lib/python3.7/site-packages:/home/weblate/weblate-env/lib/python3.7/site-packages/weblate
#WSGIProcessGroup translations.scummvm.org
#WSGIApplicationGroup %{GLOBAL}

#WSGIScriptAlias / /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py process-group=translations.scummvm.org
#WSGIPassAuthorization On

#ProxyPass / uwsgi://127.0.0.1:8080/


ProxyPass /robots.txt !
ProxyPass /favicon.ico !
ProxyPass /static/ !
ProxyPass /media/ !

ProxyPass / uwsgi://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On

<Directory /home/weblate/weblate-env/lib/python3.7/site-packages/weblate>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

SSLCertificateFile /etc/letsencrypt/live/translations.scummvm.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/translations.scummvm.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
