解決辦法:
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;
}