我的nginx得配置文件路徑在/etc/nginx/nginx.conf文件裏,只要在server配置里加一個location即可
location配置如下:
location /files {
alias /home/developer/data;
sendfile on;
tcp_nodelay on;
autoindex on;
}
在瀏覽器輸入http://ip:port/files,即可訪問服務器的/home/developer/data目錄。
我的nginx得配置文件路徑在/etc/nginx/nginx.conf文件裏,只要在server配置里加一個location即可
location配置如下:
location /files {
alias /home/developer/data;
sendfile on;
tcp_nodelay on;
autoindex on;
}
在瀏覽器輸入http://ip:port/files,即可訪問服務器的/home/developer/data目錄。