- 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.
65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
<IfModule mod_ssl.c>
|
|
<VirtualHost your-part.de:443>
|
|
ServerAdmin webmaster@your-part.de
|
|
ServerName your-part.de
|
|
ServerAlias www.your-part.de
|
|
|
|
DocumentRoot /opt/yourpart/frontend/dist
|
|
|
|
DirectoryIndex index.html
|
|
|
|
# Frontend statische Dateien
|
|
<Directory "/opt/yourpart/frontend/dist">
|
|
AllowOverride None
|
|
Options -Indexes +FollowSymLinks
|
|
Require all granted
|
|
|
|
# Fallback für Vue Router
|
|
FallbackResource /index.html
|
|
</Directory>
|
|
|
|
# Proxy-Einstellungen
|
|
ProxyPreserveHost On
|
|
ProxyRequests Off
|
|
RequestHeader set X-Forwarded-Proto "https"
|
|
AllowEncodedSlashes NoDecode
|
|
|
|
# www Redirect (muss zuerst kommen, aber nicht für Proxy-Pfade)
|
|
RewriteEngine on
|
|
RewriteCond %{SERVER_NAME} =your-part.de
|
|
RewriteCond %{REQUEST_URI} !^/(api|socket\.io|ws)/
|
|
RewriteRule ^ https://www.%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
|
|
|
# API-Requests an Backend weiterleiten (Location-Block hat höhere Priorität)
|
|
<Location "/api/">
|
|
ProxyPass "http://localhost:2020/api/"
|
|
ProxyPassReverse "http://localhost:2020/api/"
|
|
</Location>
|
|
|
|
# Socket.io: WebSocket und HTTP mit Location-Block
|
|
<LocationMatch "^/socket.io/">
|
|
# WebSocket-Upgrade
|
|
RewriteEngine on
|
|
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
|
RewriteCond %{HTTP:Connection} upgrade [NC]
|
|
RewriteRule .* "ws://localhost:2020%{REQUEST_URI}" [P,L]
|
|
|
|
# HTTP-Fallback für Polling
|
|
ProxyPass "http://localhost:2020/socket.io/"
|
|
ProxyPassReverse "http://localhost:2020/socket.io/"
|
|
</LocationMatch>
|
|
|
|
ErrorLog /var/log/apache2/yourpart.error.log
|
|
CustomLog /var/log/apache2/yourpart.access.log combined
|
|
|
|
HostnameLookups Off
|
|
UseCanonicalName Off
|
|
ServerSignature On
|
|
|
|
# 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
|
|
</VirtualHost>
|
|
</IfModule>
|