nginx 配置 /apis 替換為 http://xxx.com/api/v2
server
{
// 新增下面三行
location /apis {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://xxx.com/api/v2;
}
}
apache /apis 替換成 http://xxx/api/v2
<VirtualHost *:80>
DocumentRoot "E:\www2\laravel-blog-api\public"
ServerName blog-api
ServerAlias
ProxyPass /apis http://xxxx/api/v2
<Directory "E:\www2\laravel-blog-api\public">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
本作品採用《CC 協議》,轉載必須註明作者和本文連結