vue.js 和 php交互_vue.js 与 php前后端分离 服务器本地配置

本文档展示了如何配置Nginx服务器,针对api.bull.com和js.bull.com设置不同的监听和代理规则。对于api.bull.com,配置了PHP处理和FastCGI参数;对于js.bull.com,配置了将请求代理到localhost:8080。同时,提到了前端开发的命令行操作,如npm install和npm run dev。
摘要由CSDN通过智能技术生成

本地host:

127.0.0.1 api.bull.com

127.0.0.1 js.bull.com

nginx配置

server {

listen 80;

server_name api.bull.com;

index index.php index.html index.htm;

location / {

root D:/serversoft/upupw/7.1/htdocs/bull;

index index.html index.htm default.html default.htm index.php default.php app.php u.php;

try_files $uri $uri/ /index.php?$query_string;

}

location ~ ^.+\.php {

root D:/serversoft/upupw/7.1/htdocs/bull;

fastcgi_pass bakend;

fastcgi_index index.php;

fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

include fastcgi.conf;

}

location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {

}

location ~ /\.ht {

deny all;

}

}

server {

listen 80;

server_name js.bull.com;

location / {

proxy_pass http://localhost:8080;

}

}

开启前端:

npm install

npm run dev

6bd3c2ae4d24

image.png

6bd3c2ae4d24

image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值