user www-data www-data;

events {
    worker_connections 1024;
}

http {
    index index.php index.html;

    upstream php {
        server 127.0.0.1:9000;
    }

    server {
        include /etc/nginx/mime.types;
        include /etc/nginx/default.d/*.conf;

        listen PORT;
        server_name 0.0.0.0;
        root /app/public;

        location / {
            try_files $uri $uri/ /index.php?$args;
        }

        location ~ [^/]\.php(/|$) {
            include /etc/nginx/fastcgi_params;

            try_files $uri $uri/ /index.php?$uri;

            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO       $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

            fastcgi_pass   php;
            fastcgi_index  index.php;
        }
    }
}