Lizmap Nginx config

The Lizmap documentation explains how to serve the webapp from root url which works well: Installation de Lizmap sous Linux Debian ou Ubuntu.

http://localhost/index.php

I was wondering how to configure Nginx to serve the app under a url subdirectory:
http://localhost/**lizmap**/index.php

In Apache it is working as expected:

Alias /lizmap "/var/www/html/lizmap/"
<Directory "/var/www/html/lizmap/">
    Options +Indexes +FollowSymLinks +ExecCGI
    AllowOverride All
    Require all granted
</Directory>

Nginx doesn’t serve at http://localhost/**lizmap**/index.php with the following config trying to mirror Apache’s one:

location lizmap/ {
            alias /var/www/html/lizmap;
            index admin.php index.php;
            
            location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                set $path_info $fastcgi_path_info; # because of bug http://trac.nginx.org/nginx/ticket/321
                try_files $fastcgi_script_name =404;
                include fastcgi_params;

                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $path_info;
                fastcgi_param PATH_TRANSLATED $document_root$path_info;
                fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
                fastcgi_param SERVER_NAME $http_host;
            }
        }

I think the problem is maybe about the

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $path_info;

part.

Your $document_root may not contains lizmap (because of the the regex for php files)

Thanks Martin, you’re right.
I changed it to:
fastcgi_param SCRIPT_FILENAME $request_filename;

that allows to reach each page ok. However all dependencies (js, css, etc.) still point at root url.

Not sure how to tweak fastcgi_param PATH_INFO $path_info;