Skip to content

Instantly share code, notes, and snippets.

@fhuitelec
Last active July 16, 2018 06:47
Show Gist options
  • Save fhuitelec/67df3a5718dc03064f91d0154cde24d2 to your computer and use it in GitHub Desktop.
Save fhuitelec/67df3a5718dc03064f91d0154cde24d2 to your computer and use it in GitHub Desktop.
Medium article - PHP-FPM/NGINX one build artifact - bad conf
server {
server_name domain.tld www.domain.tld;
root /var/www/project/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php-fpm:9000; # application being the DNS to reach the php-fpm upstream
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment