错误信息 "proxy_pass" may not have URI part in location given by regular expression,
我的配置文件 
       location ~ .*\.(php|jsp|cgi)?$  {
                proxy_pass     http://192.168.2.1:8080/;
                proxy_set_header  Host $host;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
修改为 
       location ~ .*\.(php|jsp|cgi)?$  {
                proxy_pass     http://192.168.2.1:8080;
                proxy_set_header  Host $host;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
不要加斜杠,否则就会报错。  
本文出自 “Linux运维” 博客,请务必保留此出处http://2853725.blog.51cto.com/2843725/1390992
原文:http://2853725.blog.51cto.com/2843725/1390992