nginx代理前端项目

注意

1.只能有一个root, 其他用alias

2.try_files是在找不到路由的时候跳转到的页面,跳转到index.html表示将路由交给前端页面(框架)处理

 

location / {

            root   /home/hadoop/twd-ui;

            index  index.html index.htm;

         try_files $uri $uri/ /index.html;

        }

location /jr {

            alias   /home/hadoop/twd-ui-yuxi-jd/;

            index  index.html index.htm;

            try_files $uri $uri/ /jr/index.html;

         }

 

猜你喜欢

转载自www.cnblogs.com/yoyogis/p/11751362.html