Nginx转发接上一篇cd/usr/local/nginx/conf/vhostvi***.***.com.conf添加以下内容服务器{听80;#映射端口autoindexon;服务器名称***.com;#映射地址access_log/usr/local/nginx/logs/access.log合并;indexindex.htmlindex.htmindex.jspindex.php;#error_page404/404.html;如果($query_string~*".*[\;'\<\>].*"){返回404;}location/{proxy_passhttp://127.0.0.1:8080;#你要转发的地址add_headerAccess-Control-Allow-Origin*;}}Nginx作为文件服务器server{listen80;自动索引关闭;服务器名称***.com;access_log/usr/local/nginx/logs/access.log合并;indexindex.htmlindex.htmindex.jspindex.php;#error_page404/404.html;如果($query_string~*".*[\;'\<\>].*"){返回404;}位置/{root/ftpfile/;#你的服务器ftp文件地址add_headerAccess-Control-Allow-Origin*;}}重启Nginx/usr/local/nginx/sbin/nginx-sreload
