Giter VIP home page Giter VIP logo

hcloud-console's Issues

NginX `502 Bad Gateway`

Momentan verstehe ich nicht, wie man über das von der Hetzner-Cloud-API gelieferte Websocket-URL auf die NoVNC-Verbindung kommen soll:

  • Leider habe ich kein Beispiel dafür gefunden. (Evtl. kann aus dem hier ja eines entstehen?)
  • Ich erhalte immer 502 Bad Gateway von NginX gemeldet, irgendein Detail fehlt das ich bisher nicht finden konnte
  • Evtl. gehe ich die Sache auch komplett falsch an?!?

Hinweise:

  • NoVNC kann derzeit keine WSS-URLs direkt verwenden. WTF? Man muss das in den Host, Port und Pfad splitten. Doof. Sollte aber gehen, aber momentan ist da noch 502 Bad Gateway im Weg

  • Ruft man das URL mit falschen Credentials auf, dann kommt ein 401 Unauthorized.

  • Ruft man das URL mit unbekannter Server-ID auf, dann kommt ein 422, das entspricht Unprocessable Entity.

    • An Hetzner: Das würde ich ändern, so kann man Server-IDs proben, also 401 rausgeben wie bei falschen Credentials
  • Ruft man es mit korrektem von der API gelieferten URL auf, kommt hingegen 502. Sprich, es ist ein deutlicher Unterschied zum Fehlerfall zu sehen.

Testscript

url="https://${1#*wss://}"
url="${url%%#*}"

echo "URL: $url"
curl --http1.1 -s -v -N -D- -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Origin: https://www.example.org" "$url" 2>&1

Der Fehler

Kine Ahnung was mir das "Expire in X ms for Y" da sagen will, aber ich habe es mal dringelassen:

URL: https://web-console.hetzner.cloud/?server_id=HIERSTEHTNEZAHL&token=HIERSTEHTEINTOKEN
[..]
*   Trying 213.239.246.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x5572a098b280)
* Connected to web-console.hetzner.cloud (213.239.246.1) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [112 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [2644 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [300 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [37 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=*.hetzner.cloud
*  start date: Jul 26 00:00:00 2018 GMT
*  expire date: Oct 25 12:00:00 2019 GMT
*  subjectAltName: host "web-console.hetzner.cloud" matched cert's "*.hetzner.cloud"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=Thawte TLS RSA CA G1
*  SSL certificate verify ok.
} [5 bytes data]
> GET /?server_id=HIERSTEHTNEZAHL&token=HIERSTEHTEINTOKEN HTTP/1.1
> Host: web-console.hetzner.cloud
> User-Agent: curl/7.64.0
> Accept: */*
> Connection: Upgrade
> Upgrade: websocket
> Origin: https://www.example.org
> 
{ [5 bytes data]
< HTTP/1.1 502 Bad Gateway
HTTP/1.1 502 Bad Gateway
< Server: nginx
Server: nginx
< Date: Fri, 20 Sep 2019 08:22:11 GMT
Date: Fri, 20 Sep 2019 08:22:11 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 0
Content-Length: 0
< Connection: keep-alive
Connection: keep-alive
< ETag: "5d666872-0"
ETag: "5d666872-0"
< Strict-Transport-Security: max-age=3600; preload
Strict-Transport-Security: max-age=3600; preload

< 
* Connection #0 to host web-console.hetzner.cloud left intact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.