<VirtualHost *:443>
    ServerName ro-th.online
    DocumentRoot /var/www/html/ro-th-online/public
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/ro-th.online/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/ro-th.online/privkey.pem
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1

    Alias /test-apk/ /var/www/html/test-apk/
    <Directory /var/www/html/test-apk>
        Options -Indexes +FollowSymLinks
        AllowOverride None
        Require all granted
        AddType application/vnd.android.package-archive .apk
        <FilesMatch "^(RagnarokMobilePreview\.apk(\.sha256)?|latest\.json(\.gz)?)$">
            Header set Cache-Control "no-cache"
        </FilesMatch>
    </Directory>

    ProxyPass /bridge/ ws://127.0.0.1:8088/bridge/ retry=0
    ProxyPassReverse /bridge/ ws://127.0.0.1:8088/bridge/
    ProxyPass /content/ http://127.0.0.1:8088/content/ retry=0
    ProxyPassReverse /content/ http://127.0.0.1:8088/content/
    RewriteEngine On
    RewriteRule ^/api/v1/(login|register|availability)$ /ro-thailand-app-api/index.php/v1/$1 [PT,L]
    Alias /ro-thailand-app-api/ /var/www/https-storefront-root/ro-thailand-app-api/
    <Directory /var/www/https-storefront-root/ro-thailand-app-api>
        Options -Indexes +FollowSymLinks
        AllowOverride None
        AcceptPathInfo On
        Require all granted
    </Directory>

    <Directory /var/www/html/ro-th-online/public>
        Options -Indexes -FollowSymLinks
        AllowOverride None
        Require all granted
        DirectoryIndex index.html
        AddType application/wasm .wasm
        AddType application/octet-stream .data
        Header set Cache-Control "no-cache"
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/ro-th-download-error.log
    CustomLog ${APACHE_LOG_DIR}/ro-th-download-access.log combined
</VirtualHost>
