安装工具

yum -y install httpd-tools

生成配置文件

htpasswd -c test.passwd prometheus

test.passwd : 文件名
prometheus: 帐号名

配置nginx

server
{
    listen 9093;
    
  	location / {
  		proxy_pass http://localhost:3000;
  		auth_basic "Basic Authentication";
  		auth_basic_user_file "/www/server/nginx/test.passwd";
  	}
 }

更多推荐