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