Nginx: URI Path as Parameters

PHOTO EMBED

Mon Aug 29 2022 17:21:41 GMT+0000 (UTC)

Saved by @marcopinero #bash

location /worklist/ {
    try_files $uri $uri/ /worklist/index.php$is_args$args;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index worklist/index.php;
}

#
# from php you can use and index.php getting path as $_SERVER["REQUEST_URI"]
#
content_copyCOPY

you can use: /worklist/test and nginx will call /worklist/index.php with $_SERVER["REQUEST_URI"] which value is: "/worklist/test"