图片
代码
location / {
root C:/Users/JOKE/Desktop/新建文件夹/cs;
index bb.html bb.htm;
#try_files $uri $uri/ /index.html; 配置vue history模式打开
}
location /api/ {
proxy_pass http://jyx.local.yzbtkj.cn/;
#proxy_set_header: Host $host;
}
复制代码
详细代码
http {
server {
server_name localhost; //自定义域名
//本地项目
//规则匹配
location / {
alias D:/yizun/src/site; //本地代码的地址
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
location /vipAdsl/ {
//将url中以/vipAdsl/开头的请求转发到后台对应的某台server上
proxy_pass http://112.124.194.36/; //请求的真服务器地址
proxy_cookie_path /vipAdsl/ /;
proxy_cookie_path /vipAdsl /;
proxy_set_header Cookie $http_cookie;
}
}
}
复制代码
nginx 命令
start nginx //启动
nginx -s reload //重载
nginx -s stop //关闭
或通过
nginx.ext 启动
复制代码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END