解决办法: 1.首先进入到NGINX配置文件下面:

然后继续往下:

其中 “server_name”表示的是本机IP 也可设置成 “localhost”,“location”表示本地的意思 。

先看根目录“root /home/ftpuser/hry/”表示的是根路径,

“images”表示本地路径。

区别 比如访问路径“http://192.168.64.128/home/ftpuser/hry/images”

设置了根路径之后就可以更改为“http://192.168.64.128/images”

代码:

server { listen 80; server_name 192.168.64.128; location / { root html; index index.html index.htm; } location /images/ { root /home/ftpuser/hry/; autoindex on; }