Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:internetofthings:iotaiuto [2019/07/03 11:01] – [LEARNING CODICI I.R. CON BROADLINK RM Mini3/rm2] denfra | projects:internetofthings:iotaiuto [2020/08/21 10:31] (current) – [CREAZIONE + INSTALLAZIONE + ATTIVAZIONE servizio "OPENVPN" linux client + relativo CERTIFICATO] roberto | ||
---|---|---|---|
Line 117: | Line 117: | ||
==== CREAZIONE + INSTALLAZIONE + ATTIVAZIONE servizio " | ==== CREAZIONE + INSTALLAZIONE + ATTIVAZIONE servizio " | ||
+ | |||
+ | <code bash> | ||
+ | # 1. ricordarsi di aggiornare il file users.yaml sul server di iotaiuto.it con il nuovo utente e relativo ipaddr | ||
+ | # 2. eseguire poi i comandi "sctl restart cloud" + "sctl status cloud" per recepire il nuovo utente | ||
+ | # 3. chiedere a Igor di inserire il nuovo utente ed il suo nuovo ipaddr nel file dove sono censiti i DNS operanti | ||
+ | # in iotaiuto.it | ||
Line 312: | Line 318: | ||
- | **# il file da aggiornare si trova in: / | + | # il file che occorre |
- | ** | + | |
</ | </ | ||
+ | ==== Creazione Virtualhost ==== | ||
+ | Esempio pratico: __voglio creare un punto di ingresso per '' | ||
+ | In ''/ | ||
+ | |||
+ | < | ||
+ | # Questo è l' | ||
+ | server { | ||
+ | # PUNTO 1 | ||
+ | server_name roby.iotaiuto.it; | ||
+ | listen 80; | ||
+ | return 301 https:// | ||
+ | } | ||
+ | |||
+ | # Questo è l' | ||
+ | server { | ||
+ | listen 443 ssl http2; | ||
+ | # PUNTO 2 | ||
+ | server_name roby.iotaiuto.it; | ||
+ | |||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | ssl_dhparam / | ||
+ | |||
+ | add_header Strict-Transport-Security " | ||
+ | ssl on; | ||
+ | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
+ | ssl_ciphers " | ||
+ | ssl_prefer_server_ciphers on; | ||
+ | ssl_session_cache shared: | ||
+ | |||
+ | proxy_buffering off; | ||
+ | |||
+ | location / { | ||
+ | # PUNTO 3 | ||
+ | proxy_pass http:// | ||
+ | proxy_set_header Host $host; | ||
+ | proxy_redirect http:// https://; | ||
+ | proxy_http_version 1.1; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header Upgrade $http_upgrade; | ||
+ | proxy_set_header Connection $connection_upgrade; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Dopo di che eseguire un check della configurazione | ||
+ | |||
+ | <code bash> | ||
+ | root@homeassistant:/ | ||
+ | nginx: the configuration file / | ||
+ | nginx: configuration file / | ||
+ | </ | ||
+ | |||
+ | e in caso di **ok** riavviare nginx, perché acquisisca il nuovo endpoint. | ||
+ | |||
+ | <code bash> | ||
+ | root@homeassistant:/ | ||
+ | root@homeassistant:/ | ||
+ | ● nginx.service - A high performance web server and a reverse proxy server | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | Nel '' | ||
+ | Nel '' |