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

本地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

image.png
image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Page 1:nginx 服务器安装及配置文件详解 CentOS 6.2 x86_64 安装 nginx 1.1 ...
    xiaojianxu阅读 12,723评论 1 41
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,072评论 19 139
  • 我不得不承认,自己离传说中的油腻中年少女越来越近 不再天真,不再乐观,不再体贴,甚至不再善良了 我也开始像很多人一...
    梦乐阅读 1,378评论 0 0
  • 昨天和两个同事一起在公司的食堂,吃着难以下咽的中餐,依稀还记得,餐盘上错落有致盛着半生的大白菜、咸菜披身的马鲛鱼和...
    爱思考的糖阅读 2,985评论 1 2
  • 功能 在阿里云Ubuntu16.04系统上, 实现域名由HTTP改成HTTPS, 并使用阿里云的CDN加速. 准备...
    毅_1230阅读 4,538评论 0 0

友情链接更多精彩内容