First things first, you'll need to update a configuration file in the automation directory, my full path for that is: '/opt/z-way-server/automation'. The file is named 'Webserver.js' and you want to replace line
Code: Select all
ws = new WebServer(8083, function(req) {
Code: Select all
ws = new WebServer("127.0.0.1:8083", function(req) {
Code: Select all
sudo z-way-server restart
The next steps will instruct you to install nginx. I got these from a couple of different web sites and was able to "monkey" around with the configuration file to get it to work as it didn't at first.
Code: Select all
sudo apt-get update
sudo apt-get install nginx
Code: Select all
cd /etc/nginx
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/cert.key -out /etc/nginx/cert.crt
Code: Select all
sudo nano /etc/nginx/sites-enabled/default
Code: Select all
server {
listen 80;
return 301 https://$host:8085$request_uri;
}
Code: Select all
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
listen 8085;
server_name SERVERNAME;
ssl_certificate /etc/nginx/CERT.crt;
ssl_certificate_key /etc/nginx/CERT.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/z-way-server.access.log;
root /var/www;
index index.cgi;
# Make site accessible from http://localhost/
location / {
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;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://localhost:8083;
proxy_hide_header Access-Control-Allow-Origin;
proxy_read_timeout 90;
proxy_redirect http:// https://;
}