Fix more params and add upstream params

pull/2/head 1.0.2
Emilien Mantel 2015-09-21 11:47:49 +02:00
parent e4580676ce
commit 95e2cb5f12
4 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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'