By default, forever-webui installation is not accessible through the Internet, and you do not need a password to enter the management interface.
I believe that many developers need to manage their own nodejs services in the external network ~
I want to add a password for forever-webui ~
The younger brother is not good at nodejs yet. It happened that I used nginx port forwarding to bind multiple domain names.
So this time we also use nginx to add a password verification layer in the middle ~
There are two steps:
1. Generate the auth file
Reference: http://www.vpser.net/build/nginx-htpasswd.html
Run wget-c soft.vpser.net/lnmp/ext/htpasswd.shw.bash htpasswd. sh.
Enter the user name, password, and authentication file name as prompted. The script automatically generates the authentication file. Record the file path returned by the script. For example,/usr/local/nginx/conf/vpser.net. auth.
2. Modify the nginx conf file
Modify the nginx configuration file. Here we use vhost
Upstream app_node_hello {server 127.0.0.1: 8085; # proxy forever-webui port} # the nginx server instanceserver {listen 0.0.0.0: 80; server_name nodejs.uedpark.com; # pass the request to the node. js server with the correct headers and much more can be added, see nginx config options location/{proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_set_header Host $ http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http: // app_node_hello/; proxy_redirect off; # Add auth_basic "plese input forever web UI password :"; auth_basic_user_file/usr/local/nginx/conf/my. auth. conf ;}}
Then reload or restart nginx ~
Access forever-webui again.
So far, password verification is complete for forever-webui ~ There is no difficulty. It is just a way of thinking ~
You are welcome to share this article ~
References: http://www.bkjia.com/a/view/43018.html