im trying to host 2 websites with one domain and one ssl
but when i access to /lar its giving me 404 for the main website ,
can someone till me did i make somthing wrong?
the point is to host 2 websites one back-end and one front-end with one ssl and one domain like this:
mydomain.com/back-end
mydomain.com/front-end
server { listen 443 ssl; listen [::]:443 ssl; server_name my.domain; ssl_certificate /etc/nginx/ssl/my_crt.crt; ssl_certificate_key /etc/nginx/ssl/my_key.key; ssl_trusted_certificate /etc/nginx/ssl/my_bundle-bundle; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256'; root /var/www/html/crm; index index.php index.html index.htm; # location / { set $frame_ancestor_policy "frame-ancestors 'self'"; if ($remote_addr = my.ip) { set $frame_ancestor_policy "frame-ancestors 'self' my.domain.com"; } add_header Content-Security-Policy $frame_ancestor_policy; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin''*'; add_header 'Access-Control-Allow-Methods''GET, POST, OPTIONS, DELETE, PUT'; add_header 'Access-Control-Allow-Headers''Content-Type, Authorization'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Length' 0; add_header 'Content-Type''text/plain charset=UTF-8'; return 204; } add_header 'Access-Control-Allow-Origin''*'; add_header 'Access-Control-Allow-Methods''GET, POST, OPTIONS, DELETE, PUT'; add_header 'Access-Control-Allow-Headers''Content-Type, Authorization'; try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } # Handling requests for Laravel application location /lar { alias /var/www/nhc/public; try_files $uri $uri/ /index.php?$query_string; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } }}
can someone till me why its not wokring?