# Nginx configuration
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name ldapdao.local;

    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /jelixapp/tests/testapp/www/;

    location / {
        try_files $uri $uri/ =404;
    }
    location /jelix/ {
        alias /jelixapp/tests/lib/jelix-www/;
    }

    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 php:9000;
       #fastcgi_param SERVER_NAME $http_host;
       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    }
}
