- Removed outdated WebSocket handling from yourpart-https.conf for improved clarity. - Updated yourpart-websocket-fixed.conf to enable SSL and adjust WebSocket proxy settings. - Streamlined fallback logic in frontend store to ensure direct connection to the daemon on port 4551. - Enhanced logging for better debugging and monitoring of daemon connections.
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
# /etc/apache2/sites-available/yourpart-websocket.conf
|
|
<IfModule mod_ssl.c>
|
|
<VirtualHost *:4551>
|
|
ServerName www.your-part.de
|
|
|
|
# SSL aktivieren
|
|
SSLEngine on
|
|
Protocols http/1.1
|
|
|
|
# SSL-Konfiguration
|
|
Include /etc/letsencrypt/options-ssl-apache.conf
|
|
SSLCertificateFile /etc/letsencrypt/live/www.your-part.de/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/www.your-part.de/privkey.pem
|
|
|
|
# Proxy-Einstellungen
|
|
ProxyPreserveHost On
|
|
ProxyRequests Off
|
|
AllowEncodedSlashes NoDecode
|
|
|
|
# WebSocket-Upgrade (muss VOR ProxyPass stehen)
|
|
RewriteEngine On
|
|
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
|
RewriteCond %{HTTP:Connection} upgrade [NC]
|
|
RewriteRule ^/?(.*) "ws://localhost:4552/$1" [P,L]
|
|
|
|
# Fallback für normale HTTP-Requests (falls nötig)
|
|
ProxyPass / http://localhost:4552/
|
|
ProxyPassReverse / http://localhost:4552/
|
|
|
|
# CORS-Headers
|
|
Header always set Access-Control-Allow-Origin "https://www.your-part.de"
|
|
Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS"
|
|
Header always set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
|
|
|
ErrorLog /var/log/apache2/yourpart-websocket.error.log
|
|
CustomLog /var/log/apache2/yourpart-websocket.access.log combined
|
|
</VirtualHost>
|
|
</IfModule> |