Ankündigung

Einklappen
Keine Ankündigung bisher.

Amazon AWS meldet ERROR Client network socket disconnected

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • mitschel
    antwortet
    Hallo Leute,

    gute Neuigkeiten. Es geht!!!!!!


    Anhand eurer Beschreibungen bin ich jetzt selbst auf die Lösung gekommen.
    Bei Lambda musste ich bei SMARTHOME_PATH doch /alexa/ eintragen. Und dank dem Post #20 von Yachti habe ich in /etc/nginx/conf.d/https.conf nach ein paar anderen Tests bei location alexa gesehen, dass ich einen Tippfehler bei "proxy_pass http://... " hatte.

    Vielen Dank an euch. Ihr seid die Besten!!!

    Einen Kommentar schreiben:


  • AndreK
    antwortet
    Hallo @mitschel,

    Du kannst auch noch versuchen das "Diskovery" mittels einer Testfunktion in der Lambda durchzuführen. Dort kannst du vielleicht noch besser die Ursache für den Fehler erkennen.
    Oben rechts kannst du in der Lambda-Definition eine Testfunktion anlegen. (Neben dem Actions Button)
    Für das Diskovery muss die Funktion wie folgt lauten. Diese erstellen und dann mittels "Test"-Button durchführen.

    Code:
    {
    "directive": {
    "header": {
    "namespace": "Alexa.Discovery",
    "name": "Discover",
    "payloadVersion": "3",
    "messageId": "abc-123-def-456"
    },
    "payload": {
    "scope": {
    "type": "BearerToken",
    "token": "access-token-from-skill"
    }
    }
    }
    }
    Kennst Du die Doku von schuma aus dem Alexa Plugin Thread (Post #779), dort ist sehr vieles, und aktuell beschrieben.

    Gruss Andre

    P.S.: eventuell kannst Du das Ergebnis der Testfunktion posten

    Einen Kommentar schreiben:


  • yachti
    antwortet
    Hallo mitschel,

    für mich sieht die nginx Konfiguration verwirrend aus.
    Du solltest hier mal strukturiert vorgehen.
    Für Debian stretch/buster sieht das so aus:

    Im Verzeichnis /etc/nginx/sites-available befindet sich eine default Datei.
    Die zeigt die die default nginx Konfiguration.
    In diesem Verzeichnis lege ich eine Datei für meine Domain an.
    Z.B. dyndnsltd
    In dieser Datei erstelle ich meine Konfiguration für jeden Host der Domain
    z.B:
    Code:
    # alexa
    server {
    server_tokens off;
    listen 443 ssl;
    server_name alexa.dyndns.ltd;
    
    # gzip should not be used with ssl
       gzip off;
    ##
    # SSL
    # Global SSL in nginx.conf
    ##
    # ssl on;
    
     ssl_certificate /etc/letsencrypt/live/alexa.dyndns.ltd/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/alexa.dyndns.ltd/privkey.pem;
     add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
     access_log /var/log/nginx/alexa.log combined;
    
    # maintain the .well-known directory alias for letsencrypt & renewals
    location /.well-known {
    auth_basic off;
    alias /var/www/html/.well-known;
    }
    
    auth_basic "username";
    auth_basic_user_file /etc/nginx/htpasswd;
    
    location / {
    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://deineIP:9000/;
    proxy_read_timeout 90;
    }
    
    }
    Dann die Konfiguration verfügbar machen
    Code:
    sudo ln -s /etc/nginx/sites-available/dyndnsltd /etc/nginx/sites-enabled
    sudo systemctl reload nginx
    /
    Im Verzeichnis ../sites-enabled sollte dann diese Verknüpfung stehen.
    Sollten da andere Verknüpfungen vorhanden sein diese umbenen<axnen.

    Der nginx lauscht dann auf die Domain alexa.dyndns.tld

    Die Variblen in der Lambda sollten dann für das Beispiel wie folgt aussehen:

    Code:
    SMARTHOME_HOST alexa.dyndns.tld
    SMARTHOME_PORT 443
    SMARTHOME_PATH '/'
    SMARTHOME_AUTH 'username:password'
    Dann mal von aussen auf die URL alexa.dyndns.tld zugreifen. Hier sollte dann die Credentials-Abfrage kommen.
    Da kannst dann die Crendtials prüfen und im log vom nginx siehst Du ob die Weiterleitung funktioniert.

    Wenn das passt kannst Du die nginx Konfiguration in dem Verzeichnis /etc/nginx/sites-available step für step für andere Hosts erweitern.
    Den nginx neu starten nicht vergessen.

    Gruß

    Michael


    Zuletzt geändert von yachti; 07.03.2020, 12:10. Grund: Korrekturen

    Einen Kommentar schreiben:


  • mitschel
    antwortet
    Hallo André,

    ich habe beides probiert. Leider hab ich immernoch den gleichen Fehler in Lambda.
    2020-03-06T22:18:23.501Z 14db42cf-7aba-49c9-ae36-6f35484338f6 ERROR Uncaught Exception
    { "errorType": "SyntaxError",
    "errorMessage": "Unexpected token < in JSON at position 0",
    "stack": [ "SyntaxError: Unexpected token < in JSON at position 0",
    " at JSON.parse (<anonymous>)",
    " at IncomingMessage.<anonymous> (/var/task/index.js:45:21)",
    " at IncomingMessage.emit (events.js:228:7)",
    " at endReadableNT (_stream_readable.js:1185:12)",
    " at processTicksAndRejections (internal/process/task_queues.js:81:21)"
    ]
    }

    Irgendwo, ich weiß aber nicht wo, ist der Pfad für http://alexa definiert.--> wo sollte er denn hingehen?

    Muss ich vielleicht den host in der config anpassen?

    Einen Kommentar schreiben:


  • AndreK
    antwortet
    Hallo mitschel ,

    leider kenn ich das Setup des Images nicht genau. Irgendwo, ich weiß aber nicht wo, ist der Pfad für http://alexa definiert.
    Nimm mal noch das aukommentieren bei "auth_basic" weg. Das sollte aber nur der Anzeigename des Fensters beim manuellen anmelden sein (lt. NGINX-Doku)
    Versuchsweise kannst Du ja mal die Zeile
    Code:
    proxy_pass [URL]http://alexa;[/URL]
    wie folgt ändern :
    Code:
    proxy_pass [URL="http://alexa;"]http://127.0.0.1:<DEIN_PORT>;[/URL]
    <DEIN_PORT> muss dann der Port es Alexa-Plugins sein auf den das Plugin lauscht.

    Gruss Andre

    Einen Kommentar schreiben:


  • mitschel
    antwortet
    Hallo André,

    Dein Pfad in der Lambda müsste dann "/alexa " lauten.--> hab ich geändert

    Die solltest Du auf jeden Fall "einschalten" (das "#" wegnehmen) --> hab ich auch gemacht. solle ich das # nur bei auth_basic_user_file wegnehmen, oder auch bei auth_basic?

    htpasswd --> hatte ich bereits gemacht

    Es sieht für mich aus wie wenn Dein NGINX auf der gleichen Maschine wie shNG läuft. --> ja genau

    Irgendwo muss noch definiert sein wo die Weiterleitung hin geht (proxy_pass http://alexa) --> wo muss ich suchen? in der include /etc/nginx/headers.conf; seht nur
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains" always;
    add_header X-Cache $upstream_cache_status;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Xss-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Proxy-Cache $upstream_cache_status;

    Prüfe mal auf welchen Port hier weitergeleitet wird und ob dieser mit Deinem Port im Plugin selbst übereinstimmt. (Normalerweise 9001) --> wie mache ich das?

    verwendest Du das Image von OnkelAndy ? --> ja genau

    Einen Kommentar schreiben:


  • AndreK
    antwortet
    Hallo mitschel ,

    Zitat von mitschel Beitrag anzeigen
    # Alexa Plugin Weiterleitung
    location /alexa/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: Alexa";
    # auth_basic_user_file /etc/nginx/.alexa;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;
    ....
    proxy_pass http://alexa;
    Dein Pfad in der Lambda müsste dann "/alexa " lauten. Allerdings ist hier die Authentifizierung auskommentiert.
    Code:
    # auth_basic_user_file /etc/nginx/.alexa;
    Die solltest Du auf jeden Fall "einschalten" (das "#" wegnehmen) und mittels htpasswd die entsprechenden Zugangsdaten erstellen.
    Es sieht für mich aus wie wenn Dein NGINX auf der gleichen Maschine wie shNG läuft. Irgendwo muss noch definiert sein wo die Weiterleitung hin geht (proxy_pass http://alexa)

    Ich vermute das ist hier
    Zitat von mitschel Beitrag anzeigen
    include /etc/nginx/headers.conf;
    Prüfe mal auf welchen Port hier weitergeleitet wird und ob dieser mit Deinem Port im Plugin selbst übereinstimmt. (Normalerweise 9001)

    Nochmal die Frage zur Installation als solches - verwendest Du das Image von OnkelAndy ?

    Gruss Andre

    Einen Kommentar schreiben:


  • mitschel
    antwortet
    Hier mal die https.conf von nginx conf.d

    server {
    set $nw_port 8888;
    set $backend_port 8383;
    set $red_port 1880;
    server_tokens off;

    ## Blocken, wenn Zugriff aus einem nicht erlaubten Land erfolgt ##
    if ($allowed_country = no) {
    return 403;
    }

    # https://www.cyberciti.biz/tips/linux...-security.html
    ## Block download agents ##
    if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
    return 403;
    }

    ## Block some robots ##
    if ($http_user_agent ~* msnbot|scrapbot) {
    return 403;
    }

    ## Deny certain Referers ##
    if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|pok er|porn|sex|teen) )
    {
    return 403;
    }

    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name ***.spdns.de;
    ##
    # SSL
    ##

    ## Activate SSL, setze SERVER Zertifikat Informationen ##
    # Generiert via Let's Encrypt!
    ssl_certificate /etc/letsencrypt/live/***.spdns.de/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/***.spdns.de/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/***.spdns.de/fullchain.pem;
    ssl_session_cache builtin:1000 shared:SSL:60m;
    ssl_prefer_server_ciphers on;
    # unsichere SSL Ciphers deaktivieren!
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512HE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384HE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_ecdh_curve secp384r1;
    ssl_protocols TLSv1.2;
    ssl_session_timeout 60m;
    ssl_session_tickets on;
    ssl_session_ticket_key /etc/nginx/nginx_ticketkey;
    #ssl_buffer_size 16k; #for throughput, video applications
    ssl_buffer_size 4k; #for quick first byte delivery

    # Client Zertifikat spezifisch
    ssl_client_certificate /etc/ssl/ca/certs/ca.crt;
    ssl_crl /etc/ssl/ca/private/ca.crl;
    ssl_verify_client optional;
    ssl_dhparam /etc/ssl/ca/dh.pem;

    # OCSP Stapling ---
    # fetch OCSP records from URL in ssl_certificate and cache them
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;

    client_body_buffer_size 8K;
    client_max_body_size 20m;
    client_body_timeout 10s;
    client_header_buffer_size 1k;
    large_client_header_buffers 2 16k;
    client_header_timeout 5s;

    ##
    # global
    ##

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.php;

    # Proxy Caching
    # Skip^1 caching variable init
    set $nocache 0;
    # Bypass^2 caching variable init
    set $purgecache 0;

    # Bypass^2 cache on no-cache (et al.) browser request
    if ($http_cache_control ~ "max-age=0")
    { set $purgecache 1; }
    if ($http_cache_control ~ "no-cache")
    { set $purgecache 1; }
    # Bypass^2 cache with custom header set on request
    if ($http_x_cache_purge ~* "true")
    { set $purgecache 1; }

    location ~* favicon|apple-touch-icon|android-chrome-|mstile-|safari-pinned-tab.svg|browserconfig.xml|manifest.json|apple-icon|ms-icon|android-icon|mstile {
    try_files $uri @favicons;
    }

    location @favicons {
    rewrite ^/(.+)$ /favicons/$1 last;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|xml)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    # Weiterleitung zu SmartHomeNG (Websocket Schnittstelle) mit Basic Auth
    location = / {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: smartVISU2.9";
    # auth_basic_user_file /etc/nginx/.smartvisu;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    # Nur Websocket Verbindungen gegen "/" durchlassen!
    if ($http_upgrade = websocket) {
    proxy_pass http://websocket;
    }

    }

    # Zugriff auf die smartVISU mit Basic Auth
    location /smartVISU {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: smartVISU2.9";
    # auth_basic_user_file /etc/nginx/.smartvisu;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    #This is alternative to the lua script but doesn't work with Apple devices.
    #if ($ssl_client_verify != SUCCESS) {
    # return 403;
    #}
    proxy_pass http://sv/smartVISU;
    }

    # Zugriff auf die smartVISU 2.9 mit Basic Auth
    location /smartVISU2.9 {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: smartVISU2.9";
    # auth_basic_user_file /etc/nginx/.smartvisu;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://sv/smartVISU2.9;
    }

    # Zugriff auf nodered
    location /red/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: smartVISU2.9";
    # auth_basic_user_file /etc/nginx/.smartvisu;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://$server_addr:$red_port;
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$red_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }
    }

    # Alexa Plugin Weiterleitung
    location /alexa/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: Alexa";
    # auth_basic_user_file /etc/nginx/.alexa;
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://alexa;
    }

    # Backend Plugin Weiterleitung
    location /gstatic/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    #auth_basic "Restricted Area: Smarthome NG Backend";
    #auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$backend_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    proxy_pass http://$server_addr:$backend_port;
    }

    location /visu_websocket/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    #auth_basic "Restricted Area: Smarthome NG Backend";
    #auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'

    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$backend_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    proxy_pass http://$server_addr:$backend_port;
    }

    location /api/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    #auth_basic "Restricted Area: Smarthome NG Backend";
    #auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'

    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$backend_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    proxy_pass http://$server_addr:$backend_port;
    }

    location /admin/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    #auth_basic "Restricted Area: Smarthome NG Backend";
    #auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'

    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$backend_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    proxy_pass http://$server_addr:$backend_port;
    }

    location /backend/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    #auth_basic "Restricted Area: Smarthome NG Backend";
    #auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'

    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://$server_addr:$backend_port;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }

    proxy_pass http://$server_addr:$backend_port;
    }

    # Network Plugin Weiterleitung
    location /shnet/ {
    include /etc/nginx/headers.conf;
    satisfy any;
    # auth_basic "Restricted Area: Smarthome NG Network";
    # auth_basic_user_file /etc/nginx/.shng;
    proxy_set_header Authorization "Basic c21hcnRob21lCg==";
    # Create your base64 Passwort on the commandline: openssl enc -base64 <<< '<PASSWORD>'
    allow 127.0.0.1;
    allow 192.168.0.0/16;
    allow 10.0.0.0/16;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    rewrite ^/shnet/(.*) /$1 break;
    proxy_pass http://$server_addr:$nw_port;

    }

    # Weiterleitung zu Grafana
    location /grafana/ {
    satisfy any;
    allow 127.0.0.1;
    allow 10.0.0.0/8;
    allow 192.168.0.0/16;
    # auth_basic "Restricted Area: Monit";
    # auth_basic_user_file /etc/nginx/.monit;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://grafanahost/;
    include /etc/nginx/headers.conf;
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
    rewrite ^/grafana/(.*) /$1 break;
    include /etc/nginx/headers.conf;
    expires 7d;
    add_header Cache-Control "public, no-transform";
    proxy_pass http://grafanahost;
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;
    }
    }

    # Weiterleitung zu Monit
    location /monit/ {
    satisfy any;
    allow 127.0.0.1;
    allow 10.0.0.0/8;
    allow 192.168.0.0/16;
    # auth_basic "Restricted Area: Monit";
    # auth_basic_user_file /etc/nginx/.monit;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    rewrite ^/monit/(.*) /$1 break;
    proxy_pass http://monithost;
    include /etc/nginx/headers.conf;

    location ~* favicon.ico {
    alias /var/www/html/favicon/monit/favicon.ico;
    }
    }

    # Weiterleitung zu Monitgraph
    location /monitgraph/ {
    satisfy any;
    allow 127.0.0.1;
    allow 10.0.0.0/8;
    allow 192.168.0.0/16;
    # auth_basic "Restricted Area: Monitgraph";
    # auth_basic_user_file /etc/nginx/.monit;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://mainhost/monitgraph/;
    include /etc/nginx/headers.conf;
    }

    # Weiterleitung zu phpmydmin
    location /phpmyadmin/ {
    satisfy any;
    allow 127.0.0.1;
    allow 10.0.0.0/8;
    allow 192.168.0.0/16;
    # auth_basic "Restricted Area: PHP MyAdmin";
    # auth_basic_user_file /etc/nginx/.monit;
    allow ::1;
    deny all;

    # This script tests the SSL certificate and enables Websocket access with Apple devices.
    # If you want to limit your access to devices with certificates (recommended!), don't remove this line!
    access_by_lua_file /etc/nginx/scripts/hass_access.lua;

    proxy_pass http://mainhost/phpmyadmin/;
    include /etc/nginx/headers.conf;
    }
    }

    Einen Kommentar schreiben:


  • mitschel
    antwortet
    Zitat von yachti Beitrag anzeigen
    Hallo mitschel,

    Ob die Zugangsdaten richtig gesetzt sind kannst Du selber überprüfen indem Du von extern auf die URL zugreifst.
    https://foobar.dyndns.tld
    Dann sollte eine Benutzer und Passwortabfrage kommen.

    Gruß
    Michael
    Hallo Yachti.
    also von außen komme ich drauf. Da bekomme ich die "Welcome to nginx" Seite, aber keine Passwortabfrage

    Einen Kommentar schreiben:


  • yachti
    antwortet
    Hallo mitschel,

    Ob die Zugangsdaten richtig gesetzt sind kannst Du selber überprüfen indem Du von extern auf die URL zugreifst.
    https://foobar.dyndns.tld
    Dann sollte eine Benutzer und Passwortabfrage kommen.

    Gruß
    Michael

    Einen Kommentar schreiben:


  • AndreK
    antwortet
    Hallo mitschel,

    Zitat von mitschel Beitrag anzeigen
    Ja, die habe ich auch gesetzt. Ich bin mir nur nicht sicher, ob ich bei SMARTHOME_PATH nur ein / oder ein /alexa/ setzen muss.
    Das hängt davon ab wie Du Deinen NGINX konfiguriert hast. Wenn der NGINX die Weiterleitung auf "/alexa" hat dann ist das der Pfad, wenn der NGINX alles auf Deine smarthomeNG-Maschine weiterleitet dann wäre "/" richtig.

    Port muss korrekt sein sonst wäre Dein SSLLAB-Test nicht durchgegangen.

    Dann bleibt noch die Frage ob Du die Zugangsdaten korrekt mittels htpasswd erstellt hast (siehe auch hier)
    Verwendest Du das Image von OnkelAndy bzw. läuft Dein NGINX auf Deiner smarthomeNG-Maschine ?

    Gruss Andre

    Einen Kommentar schreiben:


  • yachti
    antwortet
    Hab gerade mal geschaut bei mir läuft Node.js 12.x

    Einen Kommentar schreiben:


  • yachti
    antwortet
    Hallo mitschel,
    bei mir ist nur / konfiguriert.
    Du hast die Variablen auch unter Umgebungsvariablen im Dialog konfiguriert?
    Die werden nicht im Funktionscode definiert!

    Einen Kommentar schreiben:


  • mitschel
    antwortet
    Hallo yachti,

    Ja, die habe ich auch gesetzt. Ich bin mir nur nicht sicher, ob ich bei SMARTHOME_PATH nur ein / oder ein /alexa/ setzen muss.

    Einen Kommentar schreiben:


  • yachti
    antwortet
    Zitat von mitschel Beitrag anzeigen

    ich habe jetzt mal auf Node 10.x umgestellt und auch einmal deinen Lambda Code getestet
    Hast Du auch die Variablen richtig gesetzt?
    Code:
    - SMARTHOME_HOST foobar.dyndns.tld
    - SMARTHOME_PORT 443 - endpoint must be https enabled!
    - SMARTHOME_PATH '/'
    - SMARTHOME_AUTH 'user:password'


    Gruß
    Michael
    Zuletzt geändert von yachti; 06.03.2020, 09:13. Grund: Code Tag eingefügt

    Einen Kommentar schreiben:

Lädt...
X