我的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目录。