Files
Connect-5/apache-config.conf
DeNNiiInc 94e9510ddd Add Apache proxy configuration for production
- Created apache-config.conf with proxy rules
- Added APACHE_FIX.md with step-by-step instructions
- Fixes 404 errors on /api and /socket.io endpoints
- Enables WebSocket support for multiplayer
2025-12-21 16:13:02 +11:00

44 lines
1.4 KiB
Plaintext

# Apache Configuration for Connect-5
# Add this to your Apache virtual host configuration
# Enable required modules (run these commands first):
# sudo a2enmod proxy
# sudo a2enmod proxy_http
# sudo a2enmod proxy_wstunnel
# sudo a2enmod rewrite
# sudo systemctl restart apache2
<VirtualHost *:443>
ServerName connect5.beyondcloud.technology
# Your existing SSL and document root settings
DocumentRoot /home/github2/apps/app-connect5
# Proxy API requests to Node.js
ProxyPreserveHost On
ProxyPass /api http://localhost:3000/api
ProxyPassReverse /api http://localhost:3000/api
# Proxy Socket.io WebSocket requests
ProxyPass /socket.io http://localhost:3000/socket.io
ProxyPassReverse /socket.io http://localhost:3000/socket.io
# WebSocket upgrade support
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://localhost:3000/$1 [P,L]
# Your existing SSL configuration
SSLEngine on
# SSLCertificateFile /path/to/cert
# SSLCertificateKeyFile /path/to/key
</VirtualHost>
# If you also need HTTP (port 80) redirect:
<VirtualHost *:80>
ServerName connect5.beyondcloud.technology
Redirect permanent / https://connect5.beyondcloud.technology/
</VirtualHost>