1、下载安装upupw ank套件,这个套件是免费的,内置了很多网络功能。最新版包括mysql 5.7的数据库以及一个phpMyAdmin的数据库管理界面。
2、进入xxxx\WebServer\Nginx\conf目录下,修改nginx.conf文件,添加如下:
http{
...
...
server {
listen 8010;
server_name localhost;
location / {
root html;
index index.html index.htm;
auth_basic "Login";
auth_basic_user_file D:/UPUPW_ANK_W64/WebServer/Nginx/conf/passwd;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
...
...
}
表示通过8010端口监听,root目录为xxxx\WebServer\Nginx\html,需要使用用户名和密码登录。
在html文件夹下创建upload目录,设置完成后就可以通过:localhost:8010/upload访问了。
3、在xxxx\WebServer\Nginx\conf目录下,添加passwd文件,内容如下:
root:123456
表示用户名为root,密码为123456
Ok,完成收工。