Created
February 6, 2017 12:49
-
-
Save sadovnik/5bf0170c3e15cc5f820cf045b553a20a to your computer and use it in GitHub Desktop.
How to pass an environment variable from Nginx to PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.php$ { | |
# Variable FOO_ENV_VARIABLE with value "bar" | |
fastcgi_param FOO_ENV_VARIABLE bar; | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.0-fpm.sock; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment