Add redirect_to_code in vhost

pull/14/head 1.0.9
Emilien Mantel 2015-12-01 16:40:34 +01:00
parent 9779555ac8
commit 0d65cd3c5c
2 changed files with 3 additions and 2 deletions

View File

@ -59,7 +59,8 @@ You can see many examples in: [tests/test.yml](tests/test.yml).
- `enable`: (O) Enable the vhost (default is true)
- `delete`: (O) Delete the vhost (default is false)
- `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www
- `redirect_to`: (O) Redirect (302) all requests to this domain. Please set scheme (http:// or https:// or $sheme).
- `redirect_to`: (O) Redirect all requests to this domain. Please set scheme (http:// or https:// or $sheme).
- `redirect_to_code`: Redirect code (default: 302)
- `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)

View File

@ -7,7 +7,7 @@
{% endblock %}
{% block template_try_files %}
return 302 {{ item.redirect_to }}$request_uri;
return {{ item.redirect_to_code | default('302') }} {{ item.redirect_to }}$request_uri;
{% endblock %}
{% block template_local_content %}