您的位置:首页 > 运维架构 > Nginx

nginx 发布多个静态项目

2017-11-14 09:59 281 查看
##################记录##################

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;
}

}

.......
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nginx