So I have two directories. One for angular and one for laravel. I am trying to deploy them on the same server (LEMP stack).
This is my nginx conf:
server {
listen 80 default_server;
charset utf-8;
location / {
root /var/www/client/;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
alias /var/www/server/public/;
index index.php;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Angular works fine. The website is shown but when I make requests to /api
I just get "not found". For example /api/register
doesnt work. What am I doing wrong?