Websocket - Proxy Error The proxy server received an invalid response from an upstream server.

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
adelphi
Beiträge: 7
Registriert: 19.08.2014 09:35:45

Websocket - Proxy Error The proxy server received an invalid response from an upstream server.

Beitrag von adelphi » 26.09.2019 14:29:56

Vhost Websocket Apache konfigurieren

Ich versuche, einen vhost Websocket für meinen Apache zu konfigurieren. Leider bekomme ich die folgende Fehlermeldung in Chrome:

Proxy Error

Code: Alles auswählen

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: Error reading from remote server
In der Apache log steht dazu:

Code: Alles auswählen

[Wed Sep 25 11:09:17.080534 2019] [proxy_http:error] [pid 28388:tid 140232636729088] (103)Software caused connection abort: [client 213.xx.xxx.xxx:16058] AH01102: error reading status line from remote server 46.xxx.xxx.xxx:8081, referer: https://fileexchanger.domain.de/
[Wed Sep 25 11:09:17.080615 2019] [proxy:error] [pid 28388:tid 140232636729088] [client 213.xx.xxx.xxx:16058] AH00898: Error reading from remote server returned by /favicon.ico, referer: https://fileexchanger.domain.de/
in meiner Console stehen folgende Fehlermeldungen:

Code: Alles auswählen

Refused to load the font 'data:application/font-woff2;base64,d09GMgABAAAAAQ5sABIAAAADuOQAAQ4EAAEAgwAAAAAAAAAAAAAAAAAAAAAAAAAAG4SpIhy4XhSHMgZgAJJmCF4JgnMREAqGskiFyggSgrVoATYCJAOdOAuOXgAEIAWPGAfGYAyDGFsKfLME/nOMvX+HnQoMqyRqK6tt2TW8K2BDX9Umu4PZkCXwtMjpcHYNTx6UUmu30UdwcxxnVMvcNgAim7rdXiPZ////////////C5dF2ObuXM7ZvQeSECARwueHlaLVtkJEIaLRAI3ulswSE13cSPdM15RCyYQuuS7A0mBqpQO9pYZWQQMqa9lQb0dpJzHxHpLyCHIi8uBdwF58nNH+YOA40OpJvEjJtaokKaUkx/N5UeSinp5TWoW1vSpFjimBgeFGeCF66U0n6ZUN/qSqC4XC11GKUNmzSy2d5Jxyqw5JzGUlJUnyi0lKkE8BlxadTZsyRm8c1/Cti2hEjzIH...FVw9csGnQ1BnbMbfzgRj3WjPytwZYWpPh3OtmsLZaNcxxqaGVqMVqFffFpU8bbs/0N1vG3POWfS7LUeB81TfHn+VbD7x/UnT3lXyFltHfdX6+X6Rzmg9d4dAISK7GlTj2zgME/JUwAETAECwABAUgUmAysrKI5shRwAchnFSMheQ8UoKlvnVbkW9mMeq2+bbO9EQ2q09Z9wzsADarYt4ftoamBDi8gmfbZKnl+lkZWyRx1VYVSIpVFXs9VXy9ytCyTNYt09YIAGKjqpDT22SgOdP5OsdAK/vOCXFnrpEwA/PPTJiopB7HxZV+MlaGCT/04K/LY3kjPYV/YR146Ggg+9sX6na/c2So+Epz3PXve3PKRylPIhNZASBUYVDIGhikiWc1jj/claeVCJvljX7JfvO+xhfTDIjSXBs4HV16Ol/BMfcuFQ4NRmDOWEh6diOI6NZmGl87N9J+r2JfpW2+5NhV/fGHLO57Yavbq7zaCewa/RDxp/aSH+luOPwAA' because it violates the following Content Security Policy directive: "font-src 'self'".

lufi-up.js:637 Mixed Content: The page at 'https://fileexchanger.domain.de/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://fileexchanger.domain.de/upload'. This request has been blocked; this endpoint must be available over WSS.
spawnWebsocket @ lufi-up.js:637
(anonymous) @ lufi-up.js:8
lufi-up.js:637 Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
    at spawnWebsocket (https://fileexchanger.domain.de/js/lufi-up.js:637:20)
    at https://fileexchanger.domain.de/js/lufi-up.js:8:13
spawnWebsocket @ lufi-up.js:637
(anonymous) @ lufi-up.js:8
compiled.js:2 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at E (compiled.js:2)
    at Object.u (compiled.js:25)
    at compiled.js:25
E @ compiled.js:2
u @ compiled.js:25
(anonymous) @ compiled.js:25
2fileexchanger.domain.de/:1 Refused to load the font 'data:application/font-woff2;base64,d09GMgABAAAAAQ5sABIAAAADuOQAAQ4EAAEAgwAAAAAAAAAAAAAAAAAAAAAAAAAAG4SpIhy4XhSHMgZgAJJmCF4JgnMREAqGskiFyggSgrVoATYCJAOdOAuOXgAEIAWPGAfGYAyDGFsKfLME/nOMvX+HnQoMqyRqK6tt2TW8K2BDX9Umu4PZkCXwtMjpcHYNTx6UUmu30UdwcxxnVMvcNgAim7rdXiPZ////////////C5dF2ObuXM7ZvQeSECARwueHlaLVtkJEIaLRAI3ulswSE13cSPdM15RCyYQuuS7A0mBqpQO9pYZWQQMqa9lQb0dpJzHxHpLyCHIi8uBdwF58nNH+YOA40OpJvEjJtaokKaUkx/N5UeSinp5TWoW1vSpFjimBgeFGeCF66U0n6ZUN/qSqC4XC11GKUNmzSy2d5Jxyqw5JzGUlJUnyi0lKkE8BlxadTZsyRm8c1/Cti2hEjzIH...FVw9csGnQ1BnbMbfzgRj3WjPytwZYWpPh3OtmsLZaNcxxqaGVqMVqFffFpU8bbs/0N1vG3POWfS7LUeB81TfHn+VbD7x/UnT3lXyFltHfdX6+X6Rzmg9d4dAISK7GlTj2zgME/JUwAETAECwABAUgUmAysrKI5shRwAchnFSMheQ8UoKlvnVbkW9mMeq2+bbO9EQ2q09Z9wzsADarYt4ftoamBDi8gmfbZKnl+lkZWyRx1VYVSIpVFXs9VXy9ytCyTNYt09YIAGKjqpDT22SgOdP5OsdAK/vOCXFnrpEwA/PPTJiopB7HxZV+MlaGCT/04K/LY3kjPYV/YR146Ggg+9sX6na/c2So+Epz3PXve3PKRylPIhNZASBUYVDIGhikiWc1jj/claeVCJvljX7JfvO+xhfTDIjSXBs4HV16Ol/BMfcuFQ4NRmDOWEh6diOI6NZmGl87N9J+r2JfpW2+5NhV/fGHLO57Yavbq7zaCewa/RDxp/aSH+luOPwAA' because it violates the following Content Security Policy directive: "font-src 'self'".
Meine Apche Vhost Konfigurationsdatei:

Code: Alles auswählen

<VirtualHost 46.4.xxx.xxx:443>
  ServerName fileexchanger.domain.de
  ServerAlias fileexchanger.domain.de
  DocumentRoot /srv/www/fileexchanger/home/www
  SSLProxyEngine on
  SSLEngine on
  SSLCertificateKeyFile /etc/ssl/private/name_df.key
  SSLCertificateFile    /etc/ssl/certs/name.de_df.crt
  SSLCertificateChainFile /etc/apache2/ssl.crt/namessl.crt
  #Protocols h2 h2c http/1.1

  RewriteEngine on
  RewriteCond ${HTTP:Upgrade} websocket [NC]
  RewriteCond ${HTTP:Connection} upgrade [NC]
  RewriteRule /(.*) "wss:/46.xxx.xxx.xxx:8081/$1" [P,L]

  ProxyRequests Off
  ProxyPreserveHost On
  #SSLProxyVerify none
  #SSLProxyCheckPeerCN off
  #SSLProxyCheckPeerName off
  #SSLProxyCheckPeerExpire off

  <Proxy *>
     Order deny,allow
     Allow from all
  </Proxy>

   <Location />
  ProxyPass https://46.xxx.xxx.xxx:8081/ timeout=7200
  ProxyPassReverse /
  LimitRequestBody 104857600
  </Location>
  ErrorLog /var/log/apache2/fileexchanger.domain.de/error.log
  CustomLog /var/log/apache2/fileexchanger.domain.de/access.log domain_vhost_combined

</VirtualHost>
Wäre für jeden Tip dankbar.

Gruß Bavra

Benutzeravatar
HZB
Beiträge: 490
Registriert: 22.10.2003 11:52:15
Wohnort: Wien

Re: Websocket - Proxy Error The proxy server received an invalid response from an upstream server.

Beitrag von HZB » 26.09.2019 20:05:57

Steht eigentlich ganz gut im Log:

Code: Alles auswählen

The page at 'https://fileexchanger.domain.de/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://fileexchanger.domain.de/upload'. This request has been blocked; this endpoint must be available over WSS.

Code: Alles auswählen

An insecure WebSocket connection may not be initiated from a page loaded over HTTPS
Da Deine Website via HTTPS aufgerufen wir erlaubt er keine ungesicherte Websocket Verbindung weil es einen Security Downgrade darstellen würde.

Anscheinend lauscht der Websocket nicht auf WSS

Code: Alles auswählen

const ws = new WebSocket('wss://yoursite.com/your-websocket-location')

Antworten