Open mpastas opened 7 years ago
Just upload your own configuration file to /opt/docker/etc/nginx/vhost.common.d/10-php.conf
(source eg. https://github.com/webdevops/Dockerfile/blob/develop/docker/php-nginx/debian-7/conf/etc/nginx/vhost.common.d/10-php.conf)
ENV vars are not enough?
Or if you dynamically want to modify the config, you could do also use the new service bootstrapping in combination with go-replace to dynamically add some things to config files.
See https://gist.github.com/hhoechtl/78bce01aefc4a65c1ffd337872f3f01f
@hhoechtl you can also use (with go-replace 1.1.x):
go-replace --mode=lineinfile --lineinfile-before='}' --regex \
-s 'fastcgi_param TESTVAR'
-r 'fastcgi_param TESTVAR testvar;'
-- /opt/docker/etc/nginx/vhost.common.d/10-php.conf
Which will replaces the line fastcgi_param TESTVAR
(if found) or add a new line just before the closing }
Result will be:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_read_timeout 1000;
fastcgi_param TESTVAR testvar;
}
go-replace 1.1.x is available with newest images :)
Hi guys!
I'm wondering if it is possible to set fastcgi_param in virtual hosts. Currently the only file that make any change in the environment variables is the default one /etc/nginx/fastcgi_params
What I'm trying: