# Apache configuration for BlackBox IK Studio
# Add this to your Apache virtual host configuration
# Usually in /etc/apache2/sites-available/000-default.conf

# Simple subdirectory deployment
# Access at: http://p0qp0q.com/IKStudio/
Alias /IKStudio /var/www/blackbox-ik-studio

<Directory /var/www/blackbox-ik-studio>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    
    # Enable CORS for GLB model loading
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
    Header set Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"
    
    # Ensure proper MIME types for 3D models
    AddType model/gltf-binary .glb
    AddType model/gltf+json .gltf
    
    # Cache static assets
    <FilesMatch "\.(jpg|jpeg|png|gif|ico|css|js|glb|gltf)$">
        Header set Cache-Control "max-age=31536000, public, immutable"
    </FilesMatch>
</Directory>

# Option 2: Virtual host deployment
# <VirtualHost *:80>
#     ServerName ik-studio.p0qp0q.com
#     DocumentRoot /var/www/blackbox-ik-studio
#     
#     <Directory /var/www/blackbox-ik-studio>
#         Options Indexes FollowSymLinks
#         AllowOverride None
#         Require all granted
#     </Directory>
# </VirtualHost>