node.js - Difficulties configuring nginx for Https -


i'm configuring 2 rapsberry pi's on home network. 1 serves data sensors on node server second pi (a webserver, running on node). both of them behind nginx proxy. after lot of configuring , searching found working solution. webserver using dataplicity make accessible www. don't use dataplicity on second pi (the server of sensordata) :

server {   listen 80;   server:name *ip-address*    location / {       proxy_set_header x-forwarded-for $remote_addr;       proxy_set_header host $http_host;       proxy_pass "http://127.0.0.1:3000";   }  }  server {  listen 443 ssl;  server_name *ip-address*   ssl on;  ssl_certificate /var/www/cert.pem  ssl_certificate_key /var/www/key.pem  location /{     add_header "access-control-allow-origin" *;     proxy_pass http://127.0.0.1:3000;  } } 

this config works. however, on computer. other computers err_insecure_response when trying access api ajax-request. certificates self-signed.. appriciated.

edit: still no fix problem. signed dataplicity second device well. fixed problem runs through third party. in future. if has answer this, please tell.

cool project, keen out.

dataplicity wormhole redirects service listening on port 80 on device public url in form https://*.dataplicity.io, , puts dataplicity certificate in front. due way https works, port being redirected via dataplicity cannot use https, mean unable forward traffic via dataplicity.io domain. tunnel device dataplicity encrypted anyway.

is there reason prefer not run dataplicity on second pi? while can run webserver locally of course, lot easier , more portable across networks if installed second instance of dataplicity on second device...

does help?

best, elliot.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -