Issues with v5 Self-hosted

I tried tirelessly to upgrade from v4 to v5 to no avail and finally got frustrated and started new.

The issue I’m having now is first, the window title always shows undefined. For instance, when on the Dashboard screen, it shows undefined:Dashboard

Secondly, if I click around to the various links in the system (Invoices, Create new Client, Dashboard, etc…it works just fine and as expected) However, if I refresh the page, I get 404 errors.

The NGINX log shows:
x.x.x.x - - [05/Aug/2022:15:52:46 -0600] “GET /dashboard HTTP/1.1” 404 1832 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36”

My NGINX config shows:
server {
server_name ninja.example.com;

root /var/www/ninja/public/;
index index.php index.html index.htm;
charset utf-8;
client_max_body_size 20M;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

if (!-e $request_filename) {
   rewrite ^(.+)$ /index.php?q= last;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log  /var/log/nginx/invoiceninja.access.log;
error_log   /var/log/nginx/invoiceninja.error.log;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php/php8.0-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    fastcgi_intercept_errors off;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;
}

location ~ /\.ht {
    deny all;
}

sendfile off;

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ninja.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ninja.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
if ($host = ninja.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen   80;
listen   [::]:80;
server_name ninja.example.com;
return 404; # managed by Certbot

}

My APP_URL in the .env is correct
I have ran php artisan optimize, just to make sure everything is loaded.

I am not sure what else to inform you on but if I’m missing something, just ask.

I have also followed the guide here:

Using the exact NGINX setup with no luck.

The undefined title issue is a known bug we are working on this.

In regards to the refresh on 404, i’m not sure about this one.