./nginx -s reload 报错

来源:11-5 nginx和域名的配置

悟空工作室

2019-03-26

配置文件如下:

admin.xxx.com.conf
server {
        listen 80;
        autoindex on;
        server_name admin.xxx.com;
        access_log /usr/local/nginx/logs/access.log combined;
        index index.html index.htm index.jsp index.php;
        #root /devsoft/apache-tomcat-7.0.73/webapps/mmall;
        #error_page 404 /404.html;
        if ( $query_string ~* ".*[\;'\<\>].*" ){
                return 404;
        }
        location = / {
                root /product/frontend/seeshu_manager_fe/dist;
                index index.html;
        }
        location ~ .*\.(html|htm)$ {
                root /product/frontend/seeshu_manager_fe/dist;
                index index.html;
        }
        location ~ .*\.do$ {
                proxy_pass http://127.0.0.1:8080/;
        }
        location / {
                try_files $uri $uri/ /index.html;
        }
}

./nginx -s reload 报错

nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /usr/local/nginx/conf/vhost/admin.xxx.com.conf:21
写回答

1回答

Rosen

2019-03-27

proxy_pass对应后面的/去掉试试

0
1
悟空工作室
非常感谢!
2019-03-27
共1条回复

React16+React-Router4 打造企业级电商后台管理系统

【毕设面试】让缺乏框架开发经验的你掌握框架开发

976 学习 · 405 问题

查看课程