php+nginx+http/https的Basic Authentication认证 发表于 2017-10-19 | 分类于 技术 | 写入帐号密码1$ sudo printf "xxxxx:$(openssl passwd -crypt *****)\n" >> /etc/nginx/pass_file xxxxx为用户名,*****为该帐号的密码 nginx配置文件 123456789101112location / { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/pass_file; root /var/www/satis/web; try_files $uri $uri/ /index.php?$query_string; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/$fastcgi_script_name; } } auth_basic_user_file /etc/nginx/pass_file;` 注意这里的路径,错了会一直404 禹都一只猫,热爱IT,支持原创 打赏 微信支付 支付宝 本文作者: olei.me 本文链接: http://blog.olei.me/2017/10/19/php-nginx-http-https的basic认证/ 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!