我需要在同一台服务器上部署我的Laravel和Angularjs应用程序。 以/ api /开头的网址应该转到我的php服务器并查看route.php,所有其余的应该是从角度提供的。
Angular应用程序正常运行。 但/ api / urls没有达到我的route.php
这是我的Nginx配置文件:
server {
listen 80;
server_name my-project.com;
root /var/www/my-project.com/web/my-project/Client/app;
index index.html index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
alias /var/www/my-project.com/web/my-project/Server/public/;
index index.php;
}
error_log /var/log/nginx/example.com-error.log error;
}
如果我在我的路线前加上/ api /,它会给出404,如果我没有,它会在我的回复中提供index.html。
我做错了什么?