server { listen 80 default_server; listen [::]:80 default_server; root /var/www/app/public; index index.php; location / { try_files $uri $uri/ /index.php$is_args$args; } # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }