Skip to content

Commit

Permalink
Add redirect_to_code in vhost
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Mantel committed Dec 1, 2015
1 parent 9779555 commit 0d65cd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/nginx/sites-available/_redirect.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 0d65cd3

Please sign in to comment.