Sysadmin: how to configure nginx for Jelix PHP framework

nginxjelix I had to migrate to nginx web server some web application written using Jelix PHP framework and I’ve hard a problem with Jelix URLs that look like http://domain.com/site/script.php/arg1/arg2/arg3. Originally Jelix requires “Options +MultiViews” and “AcceptPathInfo on” in Apache config, neither of which are available on nginx. It took a while to find proper solution.

It turns out that Jelix passes arguments via PathInfo parameter – I have no idea why. Anyway here is the important part of nginx configuration that allows passing this to php-fpm via fastcgi_ variables:

Both should go under server block in nginx config.

  1. Hi,

    I have currently the same problem. Have you resolved it ?

    BR,

    Eric

  2. location ~ \.php($|/) {
    set $script $uri;
    set $path_info $request_uri;
    if ($path_info ~ “^(.+)\?(.+)$”) {
    set $path_info $1;
    set $real_query_string $2;
    }
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$script;
    fastcgi_param PATH_INFO $path_info;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_param QUERY_STRING $real_query_string;
    }

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">