# vue触发vagrant中php的xdebug
思路:
- nginx代理php入口,如网址
test.com
- axios的
baseUrl
配置为test.ocm
- nginx中配置
options
方法的跨域
location / {
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin '$http_origin';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUT, DELETE, HEAD';
add_header Access-Control-Max-Age '1728000';
add_header Access-Control-Allow-Credentials 'true';
add_header Access-Control-Allow-Headers 'Origin,Content-Type,Accept,Authorization';
add_header Content-Type 'text/plain; charset=UTF-8';
add_header Content-Length '0';
return 204;
}
try_files $uri $uri/ /index.php?$query_string;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
- 配置webstorm server