diff --git a/README.md b/README.md index 8577c1d..6334261 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Socket: - `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www - `location`: (O) Add new custom locations (it does not overwrite!) - `more`: (O) Add more custom infos. + - `upstream_params`: (O) Add upstream params (useful when you want to pass variables to PHP) (O) : Optional (M) : Mandatory diff --git a/templates/etc/nginx/sites-available/_base.j2 b/templates/etc/nginx/sites-available/_base.j2 index 331a5b5..ee65e98 100644 --- a/templates/etc/nginx/sites-available/_base.j2 +++ b/templates/etc/nginx/sites-available/_base.j2 @@ -24,7 +24,7 @@ server { {% if item.more is defined and item.more is iterable %} {% for line in item.more %} - {{ item.more }} + {{ line }} {% endfor %} {% endif %} diff --git a/templates/etc/nginx/sites-available/_php.j2 b/templates/etc/nginx/sites-available/_php.j2 index f5dc23f..a857d4d 100644 --- a/templates/etc/nginx/sites-available/_php.j2 +++ b/templates/etc/nginx/sites-available/_php.j2 @@ -11,8 +11,11 @@ location ~ \.php$ { fastcgi_pass php; fastcgi_index index.php; -{# TODO: fastcgi_intercept_errors {{ item.php.intercept_errors | default('on') }}; #} - fastcgi_intercept_errors on; +{% if item.upstream_params is defined and item.upstream_params is iterable %} +{% for param in item.upstream_params %} + {{ param }} +{% endfor %} +{% endif %} {% if nginx_version.stdout | version_compare('1.6.1', 'lt') %} include fastcgi_params; {% else %} diff --git a/tests/test.yml b/tests/test.yml index 8fb9791..50e4de9 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -15,7 +15,7 @@ - 'test2-alias.local' template: '_base' more: - - 'etag off;' + - 'autoindex off;' location: '/test': - 'return 403;' @@ -23,6 +23,8 @@ - 'return 404;' - name: - 'test-php.local' + upstream_params: + - 'fastcgi_param FOO bar;' redirect_from: - 'www.test-php.local' template: '_php'