Extended Nginx class for ngx_mruby. You can exnted Nginx class by mrbgem.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib
test
.travis.yml
.travis_build_config.rb
LICENSE
README.md
mrbgem.rake

README.md

This is moved to ngx_mruby core.

mruby-ngx-mruby-ext Build Status

Extended Nginx class for ngx_mruby. You can exnted Nginx class by mrbgem.

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :git => 'https://github.com/matsumoto-r/mruby-ngx-mruby-ext.git'
end

example

  • define method by mrbgem
class Nginx
  class Headers_in
    def user_agent
      self["User-Agent"]
    end
  end
end
  • you can use the method defined by mruby-ngx-mruby-ext in ngx_mruby
Nginx.echo Nginx::Request.new.headers_in.user_agent
#=> "your user agent"

License

under the MIT License:

  • see LICENSE file