Skip to content

Commit

Permalink
Updated Drupal templates
Browse files Browse the repository at this point in the history
  • Loading branch information
thePanz committed Apr 11, 2017
1 parent fd99b13 commit 9b62942
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ This project try to follows [Semantic Versioning](http://semver.org/) since the

For migration information, you can always have a look at https://liip-drifter.readthedocs.io/en/latest/migrations/.

## [Unpublished]

### Fixed
- Nginx role: Fixed Drupal templates and rewrite rule

## [1.2.0] - 2017-03-28

### Added
Expand Down
18 changes: 15 additions & 3 deletions provisioning/roles/nginx/templates/drupal6-site.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
return 403;
}

# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}

# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
return 403;
}

location / {
try_files $uri @rewrite;
}
Expand All @@ -27,7 +39,7 @@
try_files $uri @rewrite;
}

location @rewrite {
rewrite ^ /index.php;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
{% endblock %}
19 changes: 16 additions & 3 deletions provisioning/roles/nginx/templates/drupal7-site.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
return 403;
}

# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}

# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
return 403;
}

location / {
try_files $uri /index.php?$query_string;
}
Expand All @@ -33,7 +45,8 @@
try_files $uri /index.php?$query_string;
}

location @rewrite {
rewrite ^ /index.php;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}

{% endblock %}
18 changes: 15 additions & 3 deletions provisioning/roles/nginx/templates/drupal8-site.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
return 403;
}

# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}

# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
return 403;
}

location / {
try_files $uri /index.php?$query_string;
}
Expand All @@ -33,9 +45,9 @@
try_files $uri /index.php?$query_string;
}

location @rewrite {
rewrite ^ /index.php;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}

# In Drupal 8, we must also match new paths where the '.php' appears in
# the middle, such as update.php/selection. The rule we use is strict,
Expand Down

0 comments on commit 9b62942

Please sign in to comment.