Skip to content

Instantly share code, notes, and snippets.

@marzsv
Created July 5, 2018 00:27
Show Gist options
  • Save marzsv/738e003e12d688ce2fab4f35faa13027 to your computer and use it in GitHub Desktop.
Save marzsv/738e003e12d688ce2fab4f35faa13027 to your computer and use it in GitHub Desktop.
Passing environment variables from Nginx to PHP-FPM
server {
listen 8000;
server_name mysite.local;
root /Users/mario/Code/mysite;
location ~ \.php(/|$) {
include fastcgi_params;
fastcgi_pass unix:/Users/mario/.phpbrew/php/php-5.6.31/var/run/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
# Custom environment variable
fastcgi_param DEBUG true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment