ngnix 配置小记

2020-08-06  本文已影响0人  JakeBless

同一个端口,不同路径配置, 非根路径时,要将root替换为alias

        location / {
            root   html;
            index  index.html index.htm;
        }

        location /easyform {
           alias /var/www/work/dist/;
           index index.html index.html;
        }

新增端口配置

   server {
        listen       81;
       server_name  localhost;

     location / {
           root    /var/www/work/dist;
           index  index.html index.htm;
      }
   }

代理配置

location / {
   proxy_pass http://127.0.0.1:3000;
}
上一篇 下一篇

猜你喜欢

热点阅读