nginx代理本地文件夹
修改nginx.conf文件
server {
#端口(本机没有使用过的端口)
listen 8099;
server_name "测试文件夹代理服务";
#配置跨域
add_header access-control-allow-origin *;
add_header access-control-allow-methods get,post,options;
add_header access-control-allow-headers content-type,authorization;
location / {
#代理的本地文件夹
root d:\softwaredata\ttt;
#开启目录浏览功能;
autoindex on;
#关闭详细文件大小统计,让文件大小显示mb,gb单位,默认为b;
autoindex_exact_size off;
#开启以服务器本地时区显示文件修改日期!
autoindex_localtime on;
}
}启动nginx(start nginx.exe)

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论