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):

pic_f591ae80.png

原文地址:https://www.cnblogs.com/hustshu/p/15596964.html