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 [2020/07/21 12:59] – [CREAZIONE + INSTALLAZIONE + ATTIVAZIONE servizio "OPENVPN" linux client + relativo CERTIFICATO] roberto | projects:internetofthings:iotaiuto [2020/08/21 10:31] (current) – [CREAZIONE + INSTALLAZIONE + ATTIVAZIONE servizio "OPENVPN" linux client + relativo CERTIFICATO] roberto | ||
|---|---|---|---|
| Line 122: | Line 122: | ||
| # 2. eseguire poi i comandi "sctl restart cloud" + "sctl status cloud" per recepire il nuovo utente | # 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  | # 3. chiedere a Igor di inserire il nuovo utente ed il suo nuovo ipaddr nel file dove sono censiti i DNS operanti  | ||
| - | # in iuotaiuto.it | + | # in iotaiuto.it | 
| Line 323: | Line 323: | ||
| </ | </ | ||
| + | ==== 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 '' | ||