nginx 從 conf 檔設定 html 資料夾路徑

1
2
3
4
5
6
7
8
9
server {
listen 80;
server_name localhost;

location / {
root html;
index index.html index.htm;
}
}

改為

1
2
3
4
5
6
7
8
9
server {
listen 80;
server_name localhost;

location / {
root /Users/idlefox/Sites;
index index.html index.htm;
}
}

在執行重新讀取設定檔指令

1
$ sudo nginx -s reload