Running jslib examples#
This section describes how to configure jslib to display frame processing results.
1․ Launch LUNA PASS in container mode.
2․ Make sure NGNIX is installed.
3․ Make sure that SSL certificates are used or generated, for example:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/certs/servername.key -out /etc/nginx/certs/servername.crt
4․ Create an nginx configuration to display static example files. To do this:
4․1. Login via SSH to the server;
4․2. Go to the directory with configuration files:
cd /etc/nginx/conf.d/
4․3 Create a configuration for luna-pass:
nano luna-pass.conf
Example content:
upstream lunapassapi {
server 10.16.30.144:8321;
}
server {
listen 443 ssl;
ssl_certificate /root/10.16.30.144.crt;
ssl_certificate_key /root/10.16.30.144.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH";
add_header Strict-Transport-Security 'max-age=604800';
root /var/lib/luna/luna_pass_1.11.4/jslib/examples;
index index.html;
location /ws {
error_log /var/lib/luna/logs/error.log;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://lunapassapi;
}
location/{
try_files $uri $uri/ /index.html =404;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
}
4․4. Save and check the syntax of nginx configs:
[root@nginx-test conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
4․5. Restart nginx
systemctl restart nginx
5․ Check the operation of jslib on the page with examples of luna-pass https://<server_ip>
.