<VirtualHost *:80>
    ServerName datanet.lencraftserver.de
    Redirect permanent / https://datanet.lencraftserver.de/
</VirtualHost>

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

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

    ErrorDocument 503 https://datanet.lencraftserver.de/error/503

    XSendFile On
    XSendFilePath /var/www/datanet/downloads/

    Alias /convert "/srv/dev-disk-by-uuid-74d43649-de72-4984-a696-52f22e785af9/Cloud/Lenny Strauhal/Videos"

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

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

	<Location "/server-status">
	    SetHandler server-status
	    Require ip 146.52.226.86
	</Location>

	# Studio Proxy
	ProxyPass        /obsStatus/live ws://127.0.0.1:3001/live
	ProxyPassReverse /obsStatus/live ws://127.0.0.1:3001/live

	ProxyPass        /obsStatus http://127.0.0.1:3001/
	ProxyPassReverse /obsStatus http://127.0.0.1:3001/

	ProxyPass /socket.io http://127.0.0.1:3001/socket.io
	ProxyPassReverse /socket.io http://127.0.0.1:3001/socket.io

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