Skip to content

Instantly share code, notes, and snippets.

@Chekote
Last active July 5, 2018 18:56
Show Gist options
  • Save Chekote/2604f7138c53bc2898d05cefa164616d to your computer and use it in GitHub Desktop.
Save Chekote/2604f7138c53bc2898d05cefa164616d to your computer and use it in GitHub Desktop.
nginx config for remote php-fpm
server {
listen 80;
server_name WEBSERVER_HOSTNAME_GOES_HERE;
root /var/www/public;
index index.html index.php;
access_log syslog:server=unix:/dev/log;
error_log syslog:server=unix:/dev/log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
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_FPM_HOSTNAME_GOES_HERE:9000;
fastcgi_index index.php;
}
# set client body size to 2M #
client_max_body_size 2M;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment