1. IP限制
    //修改server配置文件
    allow 192.168.137.2;
    deny all;

     

  2. auth basic
    auth_basic  "Admin only"
    auth_basic_user_file  /etc/nginx/.htpassed
    //安装htpasswd
    sudo apt install apach2-utils
    
    sudo htpasswd -c /etc/nginx/.htpasswd admin

     

posted on 2019-06-09 21:47  jzfan  阅读(116)  评论(0编辑  收藏  举报