<VirtualHost *:80>
    ServerName live.lencraftserver.de

    DocumentRoot /var/www/datanet

    # Let's Encrypt Challenge
    Alias /.well-known/acme-challenge/ /var/www/datanet/.well-known/acme-challenge/
    <Directory "/var/www/datanet/.well-known/acme-challenge/">
        Options None
        AllowOverride None
        Require all granted
    </Directory>

    # Weiterleitung auf HTTPS, außer /.well-known/acme-challenge/
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName live.lencraftserver.de
    DocumentRoot /var/www/live

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

    <Directory /var/www/live>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

	Alias /live /srv/dev-disk-by-uuid-74d43649-de72-4984-a696-52f22e785af9/Archiv/stream/live

	<Directory /srv/dev-disk-by-uuid-74d43649-de72-4984-a696-52f22e785af9/Archiv/stream>
	    Options -Indexes +FollowSymLinks
	    AllowOverride None
	    Require all granted
	    Header set Access-Control-Allow-Origin "*"
	</Directory>

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/live.lencraftserver.de/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/live.lencraftserver.de/privkey.pem
</VirtualHost>
</IfModule>
