nginx 发布多个静态项目

来源:互联网 发布:淘宝2016开学爆到活动 编辑:程序博客网 时间:2024/06/18 06:15

##################记录##################


1) 使用nginx 配置 nginx.conf 多个 server 


.......server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   D:\work\web;try_files $uri $uri/ @router;            index  index.html index.htm;        }location @router {rewrite ^.*$ /index.html last;        }        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }          }server {        listen       8081;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   D:\work\dist;try_files $uri $uri/ @router;            index  index.html index.htm;        }location @router {rewrite ^.*$ /index.html last;        }        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }             }.......