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

vue.js 与 php前后端分离 服务器本地配置_第1张图片
image.png
vue.js 与 php前后端分离 服务器本地配置_第2张图片
image.png

你可能感兴趣的:(vue.js 与 php前后端分离 服务器本地配置)