<VirtualHost *:80>

  ServerName $SUBDOMAIN

  ServerAdmin $MAILADDRESS

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  Alias /static /srv/AKPlanning/static
  <Directory /srv/AKPlanning/static>
  Require all granted
  </Directory>

  ProxyPassMatch ^/static/ !
  ProxyPass / uwsgi://127.0.0.1:3035/

  RewriteEngine on
  RewriteCond %{SERVER_NAME} =$SUBDOMAIN
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>

  ServerName $SUBDOMAIN

  ServerAdmin $MAILADDRESS


  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  Alias /static /srv/AKPlanning/static
  <Directory /srv/AKPlanning/static>
  Require all granted
  </Directory>


  ProxyPassMatch ^/static/ !
  ProxyPass / uwsgi://127.0.0.1:3035/
  ProxyPassReverse / uwsgi://127.0.0.1:3035/


  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile $PATHTOfullchain.pem
  SSLCertificateKeyFile $PATHTOprivkey.pem
</VirtualHost>
</IfModule>
