1、找到nginx\conf\nginx.conf下的nginx.conf文件。找到如下代码段:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
2、将其中的root html的“html”改为你想要对外暴露的目录,如:root /data/img/;修改后的代码段:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /data/img/;
index index.html index.htm;
}
#error_page 404 /404.html;