server {
  listen 80;

  server_name localhost;
  root /var/www/dembelo/www/web;

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

  #strip app.php/ prefix if it is present
  rewrite ^/app\.php/?(.*)$ /$1 permanent;

  location / {
    index app.php;
    try_files $uri @rewriteapp;
  }

  location @rewriteapp {
    rewrite ^(.*)$ /app.php/$1 last;
  }

  # pass the PHP scripts to FastCGI server listening socket
  location ~ ^/(app|app_dev)\.php(/|$) {
    fastcgi_pass unix://var/run/php/php7.1-fpm.sock;
    fastcgi_keep_conn on;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  HTTPS              off;
  }

}