Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Fix compatibility with ngx_mruby 1.18.4+
Browse files Browse the repository at this point in the history
The `mruby_post_read_handler` directive should always have been outside
the `location` block, however due to a bug in ngx_mruby the previous
implementation happened to still work.

In ngx_mruby 1.18.4 this silently stopped being the case:
matsumotory/ngx_mruby#210

And in ngx_mruby 1.18.5 this incorrect usage was turned into an error:
matsumotory/ngx_mruby#217

Moving `mruby_post_read_handler` outside the location block is a no-op
for the older ngx_mruby currently used by this buildpack, but ensures
compatibility with the newer ngx_mruby being used in the upcoming
Heroku-20 support PR.

See matsumotory/ngx_mruby#210.
  • Loading branch information
edmorley committed Nov 7, 2020
1 parent 0dfb606 commit 1746b9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* [#181](https://github.com/heroku/heroku-buildpack-static/pull/181) Fix compatibility with ngx_mruby 1.18.4+
* [#177](https://github.com/heroku/heroku-buildpack-static/pull/177) Make curl retry in case of a failed download
* [#177](https://github.com/heroku/heroku-buildpack-static/pull/177) Fix the printing of the installed nginx version
* [#177](https://github.com/heroku/heroku-buildpack-static/pull/177) Switch to the recommended S3 URL format
Expand Down
3 changes: 2 additions & 1 deletion scripts/config/templates/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ http {
auth_basic_user_file <%= basic_auth_htpasswd_path %>;
<% end %>

mruby_post_read_handler /app/bin/config/lib/ngx_mruby/headers.rb cache;

location / {
mruby_post_read_handler /app/bin/config/lib/ngx_mruby/headers.rb cache;
mruby_set $fallback /app/bin/config/lib/ngx_mruby/routes_fallback.rb cache;
<% if clean_urls %>
try_files $uri.html $uri $uri/ $fallback;
Expand Down

0 comments on commit 1746b9e

Please sign in to comment.