1.nginx设置 nginx.conf2
server {
listen 8881;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
// 本地访问图片
location /map/ {
alias D:/A-Software/MapTileDownloader/map/mapabc/satellite/;
autoindex on;
}
}
我的本地图片地址如图:
2.启动nginx
3.访问: http://localhost:8881/map/图片其他路径
例如:http://localhost:8881/map/14/13517/6393.jpg
备注:如果404
1.在 任务管理器中 彻底关闭 nginx ,然后重启
2.alias 设置,最后一定要有/