Zitat von patrickgoll
Beitrag anzeigen
Ankündigung
Einklappen
Keine Ankündigung bisher.
Amazon Alexa Plugin
Einklappen
X
-
In sites-available sind 2. Die your-home und die default
default
Code:upstream php { server localhost:9090; } server { listen 80 default_server; server_name xyz.spdns.eu; satisfy any; allow 192.168.1.0/24; deny all; auth_basic "SmartVisu Anmeldung"; auth_basic_user_file /etc/nginx/htpasswd.smartvisu; root /var/www/html; index index.php index.html index.htm; location / { autoindex on; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9090; fastcgi_read_timeout 300; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location /.well-known { allow all; } }
Code:# SSL-Redirect & LetsEncrypt Endpoint server { listen 80 default_server; # redirect every requested $host (any, even invalid ones) to its SSL URL location / { return 301 https://$host$request_uri; } # LetsEncrypt Endpoint location /.well-known { alias /var/www/html/.well-known; } } # Sitemap # server { # listen 443 ssl default_server; # # access_log /var/log/nginx/sitemap.log combined; # auth_basic "xyz.spdns.eu"; # auth_basic_user_file /etc/nginx/htpasswd; # include /etc/nginx/include.d/common; # # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; # # location / { # root /var/www/html/sitemap; # index index.html; # } # } # Alexa server { listen 443 ssl; server_name xyz.spdns.eu; access_log /var/log/nginx/alexa.log combined; auth_basic "Alexa"; auth_basic_user_file /etc/nginx/htpasswd.alexa; include /etc/nginx/include.d/common; location / { proxy_pass http://192.168.1.13:9000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
Kommentar
-
Okay alles klar. Wir machen folgendes:
Du nimmst einen Teil der your-home und dann kombinieren wir das mit dem server 80 part in der default.
Deine kombinierte default sollte dann so aussehen:
Code:upstream php { server localhost:9090; } server { listen 80 default_server; server_name smartvisu36.spdns.eu; satisfy any; allow 192.168.1.0/24; deny all; auth_basic "SmartVisu Anmeldung"; auth_basic_user_file /etc/nginx/htpasswd.smartvisu; root /var/www/html; index index.php index.html index.htm; location / { autoindex on; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9090; fastcgi_read_timeout 300; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location /.well-known { allow all; } } # Alexa server { listen 443 ssl default_server; server_name smartvisu36.spdns.eu; access_log /var/log/nginx/alexa.log combined; auth_basic "Alexa"; auth_basic_user_file /etc/nginx/htpasswd.alexa; include /etc/nginx/include.d/common; location / { proxy_pass http://192.168.1.13:9000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
Dann nginx durchstarten und alles sollte gehen denke ich.Zuletzt geändert von patrickgoll; 23.09.2017, 16:16.
Kommentar
-
Und wie hast du intern aufgerufen? http://192.168.1.13/smartVISU ? Das sollte meiner Meinung nach der einzig korrekte Aufruf sein.
Kommentar
-
http://192.168.1.13/smartVISU -- so geht´s!
Perfekt, du hast mein Wochenende gerettet. Und das meiner Frau.
Eine hoffentlich letzte Frage:
Wenn ich das System neu aufsetze, muss ich dann den certbot wieder ausführen, oder den well-known Ordner kopieren?
Kommentar
-
Zitat von henfri Beitrag anzeigenDen certbot musst du doch eh regelmäßig aufrufen um das Zertifikat zu erneuen
Kommentar
-
Es wäre ja zu schön gewesen...
Mir ist noch was aufgefallen. Beim externen Aufruf der Visu, kann ich nichts schalten.(Could´nt connect to sh.py server)
Ich hab im Smartvisu-Forum einen passenden Thread dazu gefunden. (https://knx-user-forum.de/forum/supp...-reverse-proxy)
Da sollte folgendes funktionieren:
Zitat von kaiwerner Beitrag anzeigen../sites-enabled/smarthome
Code:server { listen 443 ssl; server_name smarthome.home.***.de; ssl_certificate /etc/ssl/certs/smarthome@***.de.crt; ssl_certificate_key /etc/ssl/private/smarthome_private_key.pem; ssl_client_certificate /etc/ssl/ca/ca.crt; ssl_verify_client on; # ssl_verify_client off; location / { root /var/www/html; index index.html index.php; autoindex on; if ($http_upgrade = websocket) { proxy_pass http://localhost:2424; } } location ~ \.php$ { root /var/www/html; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } } server { listen 80; server_name smarthome.home.***.de; # return 301 https://$server_name$request_uri; location / { root /var/www/html; index index.html index.php; autoindex on; if ($http_upgrade = websocket) { proxy_pass http://localhost:2424; } } location ~ \.php$ { root /var/www/html; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } location /baos { return 301 http://debiantest.home.***.de/baos; } # location ~ ^/post/(.*) { # rewrite ^ http://debiantest.home.***.de/post/$1; # } }
[Edit]
Und in Smartvisu "ws://" durch "wss://" ersetzen und Port von 2424 auf 443 geändert.
Nur leider weiß ich jetzt nicht, wie ich das auf meine nginx Konfiguration umbauen muss.
Code:upstream php { server localhost:9090; } server { listen 80 default_server; server_name xyz.spdns.eu; satisfy any; allow 192.168.1.0/24; deny all; auth_basic "SmartVisu Anmeldung"; auth_basic_user_file /etc/nginx/htpasswd.smartvisu; root /var/www/html; index index.php index.html index.htm; location / { autoindex on; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9090; fastcgi_read_timeout 300; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location /.well-known { allow all; } } # Alexa server { listen 443 ssl default_server; server_name xyz.spdns.eu; access_log /var/log/nginx/alexa.log combined; auth_basic "Alexa"; auth_basic_user_file /etc/nginx/htpasswd.alexa; include /etc/nginx/include.d/common; location / { proxy_pass http://192.168.1.13:9000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
Kann mir hier nochmal jemand helfen?
Gruß, MaxZuletzt geändert von Max2612; 25.09.2017, 14:18.
Kommentar
Kommentar