I have a vps server with an Ubuntu 20.4 OS.I have two Laravel projects at these paths:
first app:
/var/www/html/public/index.php
second app:
/var/www/hampa/html/public/index.php
my default nginx config:
/etc/nginx/sites-available# cat defaultserver { listen 80; server_name localhost; root /var/www/html/public; index index.php index.html index.htm; charset utf-8; client_max_body_size 100M; location /hampa { alias /var/www/hampa/html/public; index index.php index.html; try_files $uri $uri/ /hampa/public/index.php?$query_string; } location / { try_files $uri $uri/ /index.php?$query_string; } 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 ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; }}
but when I entered my IP and hampa
project I got 404 error not found.All requests are redirected first project and I get a 404 error not found for the first project.