I need to deploy 2 projects that I just finished, the ‘front’ is made in ANGULAR v16 and the ‘back’ (which is just an API) is made in LARAVEL 10, the ‘production’ Server is a UBUNTU 22.04 to which I have deployed a NGINX + MYSQL + PHP. I have deployed the projects directly in /VAR/WWW/, I have deployed the ANGULAR project in a folder named ‘integrator’ and I have deployed the LARAVEL project in a folder named BCK_INTEGRATOR.
I have the site configuration into a file called ‘integrator’ as follows:
server {
listen 80;
listen [::]:80;
server_name vmi1944075.contaboserver.net;
root /var/www/integrador;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
location / {
try_files $uri $uri/ /index.html;
}
location /api {
alias /var/www/bck_integrador/public;
try_files $uri $uri/ @bckapi;
location ~ .php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_split_path_info ^(.+?.php)(/.+)$;
}
}
location @bckapi {
rewrite /api/(.*)?$ /api/index.php?$is_args$args last;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ /.(?!well-known).* {
deny all;
}
}
The problem occurs with requests to the API, the browser responds that the routes that were defined in the ROUTES of the project do not exist, since in the development environment, my machine, both work without problem. What could I be doing wrong? ?
Thanks in advance for the support.
OC