Skip to content

Commit

Permalink
Merge pull request #6 from HanXHX/tryfiles
Browse files Browse the repository at this point in the history
Add feature: override_try_files on vhost
  • Loading branch information
HanXHX committed Oct 17, 2015
2 parents eaf4032 + 050c164 commit bf1b995
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ You can see many examples in: [tests/test.yml](tests/test.yml).
- `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)
- `override_try_files`: (O) overrides default try\_files defined in template

(O) : Optional
(M) : Mandatory
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/nginx/sites-available/_base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ server {

location / {
{% block template_try_files %}
try_files $uri $uri/ =404;
try_files {{ override_try_files | default('$uri $uri/ =404') }};
{% endblock %}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/etc/nginx/sites-available/_php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% endblock %}

{% block template_try_files %}
try_files $uri $uri/ /index.php;
try_files {{ override_try_files | default('$uri $uri/ /index.php') }};
{% endblock %}

{% block template_upstream_location %}
Expand Down
1 change: 1 addition & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- 'test-alias.local'
- 'test2-alias.local'
template: '_base'
override_try_files: '$uri $uri index.htm index.html'
more:
- 'autoindex off;'
location:
Expand Down

0 comments on commit bf1b995

Please sign in to comment.