solventum-image-metadata/docs/apache/apache-config.conf
SamoilenkoVadym e5bcfcb674 docs: add comprehensive deployment and migration documentation
- Add DEPLOYMENT.md with production deployment guide
- Add README-FASTAPI.md with backend API documentation
- Add README-FULLSTACK.md with complete migration guide
- Add Apache configuration in docs/apache/ for reference

Documentation includes:
- Quick start guide for Docker Compose
- Environment variable configuration
- API endpoint documentation
- Troubleshooting guide
- Backup and maintenance procedures
- Migration statistics and improvements

Apache configuration (reference only):
- SSL/HTTPS setup
- Reverse proxy for FastAPI backend
- Static file serving for React frontend
- Security headers and caching

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
2026-02-09 13:16:17 +00:00

101 lines
3.5 KiB
ApacheConf

# Oliver Metadata Tool v4.0 - Apache Configuration
# Location: /etc/apache2/sites-available/solventum-image-metadata.conf
#
# Enable with:
# sudo a2ensite solventum-image-metadata
# sudo a2enmod proxy proxy_http headers rewrite ssl
# sudo systemctl reload apache2
<VirtualHost *:80>
ServerName ai-sandbox.oliver.solutions
# Redirect HTTP to HTTPS
Redirect permanent / https://ai-sandbox.oliver.solutions/
</VirtualHost>
<VirtualHost *:443>
ServerName ai-sandbox.oliver.solutions
# SSL Configuration
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/ai-sandbox.oliver.solutions/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ai-sandbox.oliver.solutions/privkey.pem
# Security headers
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
# =========================================================================
# Frontend - React SPA (Static Files)
# =========================================================================
# Serve static files from /var/www/html/solventum-image-metadata
DocumentRoot /var/www/html/solventum-image-metadata
<Directory /var/www/html/solventum-image-metadata>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
# Enable React Router (SPA routing)
RewriteEngine On
RewriteBase /solventum-image-metadata
# Don't rewrite files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Don't rewrite API calls
RewriteCond %{REQUEST_URI} !^/solventum-image-metadata/api/
# Rewrite everything else to index.html
RewriteRule ^ /solventum-image-metadata/index.html [L]
</Directory>
# Cache static assets
<FilesMatch "\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$">
Header set Cache-Control "public, max-age=31536000"
</FilesMatch>
# Don't cache HTML
<FilesMatch "\.(html)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
# =========================================================================
# Backend API - FastAPI (Reverse Proxy)
# =========================================================================
# Proxy API requests to FastAPI backend
ProxyPreserveHost On
ProxyTimeout 600
# API endpoints
<Location /solventum-image-metadata/api>
ProxyPass http://localhost:8000
ProxyPassReverse http://localhost:8000
# Headers for backend
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
RequestHeader set X-Real-IP "%{REMOTE_ADDR}s"
</Location>
# Allow large file uploads (500MB)
LimitRequestBody 524288000
# =========================================================================
# Logs
# =========================================================================
ErrorLog ${APACHE_LOG_DIR}/solventum-image-metadata-error.log
CustomLog ${APACHE_LOG_DIR}/solventum-image-metadata-access.log combined
# Log level (debug for troubleshooting, warn for production)
LogLevel warn
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet