flink实现简单的用户密码认证


1.安装httpd-tools工具

yum install httpd-tools -y

2.生成用户名密码文件

htpasswd -c /etc/nginx/conf.d/.ngpasswd foms

 回车输入密码

 

3.安装nginx(略)

配置nginx

server {
    listen       80;
    server_name  localhost;
​
    #access_log  /var/log/nginx/host.access.log  main;
​
    location / {
        auth_basic           "input you user name and password";
        auth_basic_user_file /etc/nginx/conf.d/.ngpasswd;
        proxy_pass http://192.168.205.106:8081;
    }
    }
重启nginx后访问

 

 

也可以配置一个虚拟访问路径(访问时加上虚拟路径)

server {
    listen       80;
    server_name  localhost;
    location /login/ {
        auth_basic           "input you user name and password";
        auth_basic_user_file /etc/nginx/conf.d/.ngpasswd;
        proxy_pass http://192.168.205.106:8081/;
    } 
http://192.168.205.106/login

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM