当前位置:   article > 正文

Node-RED启用登录的2种方式_nodered 启用后台需要登录模式

nodered 启用后台需要登录模式

1.方式一

使用node-red自带的用户认证,详见下面这篇博客

Centos7下实现Node-RED开机自启动、启用登录功能_小捣蛋1124的博客-CSDN博客

2. 方式二

使用nginx代理的方式.

需要先设置node-red的根路径,修改settings.js的httpAdminRoot为node-red

(1)密码生成(账号:admin  密码:123456)

htpasswd -bdc /etc/nginx/conf.d/noderedpwd admin 123456

(2)nginx配置

  1. location /node-red {
  2. proxy_pass http://127.0.0.1:1880;
  3.     auth_basic "Please input username and password";  
  4.     auth_basic_user_file /etc/nginx/conf.d/noderedpwd; 
  5.     autoindex on;
  6.     autoindex_exact_size on;
  7.     autoindex_localtime on;
  8. }
  9. location /node-red/comms {
  10.     proxy_pass http://127.0.0.1:1880;
  11.     proxy_read_timeout 300s;
  12.     proxy_set_header Host $host;
  13.     proxy_set_header X-Real-IP $remote_addr;
  14.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  15.     proxy_http_version 1.1;
  16.     proxy_set_header Upgrade $http_upgrade;             
  17.     proxy_set_header Connection "upgrade";
  18. }

说明:
/node-red/comms:代理的是ws
/node-red:代理的是http

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/1016279
推荐阅读
相关标签
  

闽ICP备14008679号