JustPaste.it

server {
listen 80;
server_name localhost;
root /var/www/html;
index index.html index.htm index.php;

charset utf-8;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

access_log off;
error_log stderr error;

# I'm being fairly generous max_body_size and very generous client_boidy_timeout.
# I highly recommend you configure PHP with lower values.
client_max_body_size 200m;
client_body_timeout 600s;

sendfile on;

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

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}

fastcgi_pass php-fpm:9000;
fastcgi_index index.php;

include fastcgi_params;

# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
fastcgi_intercept_errors off;
fastcgi_connect_timeout 30s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 600s;

# Removing the leading slash from $fastcgi_script_name allows it to be interpreted relative to php-fpm.conf's `chdir` directive
set $filename "index.php";
if ( $fastcgi_script_name ~ "^/+(.*)$" ) {
set $filename $1;
}
fastcgi_param SCRIPT_FILENAME $filename;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $fastcgi_path_info;
}
}