Update proxy settings in yourpart-https.conf for improved WebSocket and API handling

- Added ProxyPreserveHost and ProxyRequests directives for better request handling.
- Configured WebSocket upgrade headers for Socket.io and daemon connections.
- Established HTTP proxies for API and WebSocket requests to ensure fallback mechanisms are in place.
- Improved overall clarity and organization of proxy settings in the configuration file.
This commit is contained in:
Torsten Schulz (local)
2026-01-12 16:55:09 +01:00
parent b600f16ecd
commit 84619fb656
2 changed files with 65 additions and 12 deletions

View File

@@ -18,28 +18,36 @@
FallbackResource /index.html
</Directory>
# API-Requests an Backend weiterleiten
ProxyPass "/api/" "http://localhost:2020/api/"
ProxyPassReverse "/api/" "http://localhost:2020/api/"
# Proxy-Einstellungen
ProxyPreserveHost On
ProxyRequests Off
RequestHeader set X-Forwarded-Proto "https"
AllowEncodedSlashes NoDecode
# WebSocket-Requests an Backend weiterleiten
ProxyPass "/socket.io/" "http://localhost:2020/socket.io/"
ProxyPassReverse "/socket.io/" "http://localhost:2020/socket.io/"
# WebSocket-Upgrade-Header für Socket.io
# WebSocket-Upgrade-Header (muss VOR ProxyPass stehen!)
RewriteEngine on
# WebSocket-Upgrade für Socket.io
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/socket.io/(.*)$ "ws://localhost:2020/socket.io/$1" [P,L]
# WebSocket-Upgrade-Header für Daemon-Verbindungen
# WebSocket-Upgrade für Daemon-Verbindungen
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/ws/(.*)$ "ws://localhost:4551/$1" [P,L]
# WebSocket-Proxy für Daemon-Verbindungen mit benutzerdefiniertem Protokoll
ProxyPass "/ws/" "ws://localhost:4551/" upgrade=websocket
ProxyPassReverse "/ws/" "ws://localhost:4551/"
# API-Requests an Backend weiterleiten
ProxyPass "/api/" "http://localhost:2020/api/"
ProxyPassReverse "/api/" "http://localhost:2020/api/"
# HTTP-Proxy für Socket.io (Fallback für Polling)
ProxyPass "/socket.io/" "http://localhost:2020/socket.io/"
ProxyPassReverse "/socket.io/" "http://localhost:2020/socket.io/"
# HTTP-Proxy für Daemon (Fallback, falls WebSocket nicht funktioniert)
ProxyPass "/ws/" "http://localhost:4551/"
ProxyPassReverse "/ws/" "http://localhost:4551/"
ErrorLog /var/log/apache2/yourpart.error.log
CustomLog /var/log/apache2/yourpart.access.log combined