diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-20 15:39:53 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-20 15:39:53 -1000 |
| commit | 845dda44574fb69cf7af3c2b4df9021451db8b11 (patch) | |
| tree | 198a013de085c6febe8bb911508be9f45191d4a2 /deployment/apache.conf | |
| parent | cb592195189685471f054578390b5a6f3440187e (diff) | |
Add VPS deployment artifacts and documentation
Include systemd service file, Apache reverse proxy config,
and comprehensive deployment guide for Linux VPS setup.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'deployment/apache.conf')
| -rw-r--r-- | deployment/apache.conf | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/deployment/apache.conf b/deployment/apache.conf new file mode 100644 index 0000000..3942bf6 --- /dev/null +++ b/deployment/apache.conf @@ -0,0 +1,45 @@ +<VirtualHost *:80> + ServerName ${FQDN} + + # Redirect HTTP to HTTPS + RewriteEngine On + RewriteCond %{HTTPS} off + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] +</VirtualHost> + +<VirtualHost *:443> + ServerName ${FQDN} + + # SSL Configuration (adjust paths as needed) + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/${FQDN}/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/${FQDN}/privkey.pem + + # Document root for static files served directly by Apache + DocumentRoot /site/${FQDN}/public + + # Serve static files directly via Apache (bypasses Go app) + <Directory /site/${FQDN}/public> + Options -Indexes +FollowSymLinks + AllowOverride None + Require all granted + + # Cache static assets + <FilesMatch "\.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2)$"> + Header set Cache-Control "max-age=31536000, public" + </FilesMatch> + </Directory> + + # Static files served by Apache + Alias /static /site/${FQDN}/public + + # Proxy all other requests to Go application + ProxyPreserveHost On + ProxyPass /static ! + ProxyPass / http://127.0.0.1:8080/ + ProxyPassReverse / http://127.0.0.1:8080/ + + # Logging + ErrorLog ${APACHE_LOG_DIR}/${FQDN}-error.log + CustomLog ${APACHE_LOG_DIR}/${FQDN}-access.log combined +</VirtualHost> |
