一、正常部署一个网站
server {
# IPv4
listen 80;
listen [::]:80;
charset utf-8;
# 接入日志存储位置
access_log /data/log/nginx/scm/access.log;
#错误日志存储位置
error_log /data/log/nginx/scm/error.log;
set $mobile_rewrite do_not_perform;
# WEB前端
location / {
# 正常网站部署
root /data/scm/web;
# 保障地址最后写不写/都能访问到首页
try_files $uri /index.html;
index index.html index.htm;
}
#h5端配置 二级网站 在打包的时候尽量些一个二级目录,不过好像不弄也行
location /h5 {//这个地方最后不要添加斜杠
# 默认PC端访问,这个地方一定要用 alias,用root是不行的
alias /data/scm/h5;
# 这个地方一定要添加/h5这个二级目录或者是
try_files $uri /h5/index.html;
index index.html index.htm;
}
# 后端接口
location /prod-api/ {
proxy_pass http://127.0.0.1:8089/;
}
}

被折叠的 条评论
为什么被折叠?



