1.具体配置
- 在nginx配置文件中进行配置
server {
listen 80;
server_name 192.168.80.200;
#charset koi8-r;
#access_log logs/host.access.log main;
location /www/ {
root /data/;
index index.html index.htm;
}
location /image/ {
root /data/;
autoindex on;
}
}
- 重启nginx
2.最终测试
-
浏览器输入地址,http://192.168.80.200/image/
将图片列出,是因为在配置文件autoindex on -
浏览器输入地址,http://192.168.80.200/www/a.html

