HTTP shadow proxy using ngx_mruby.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib
LICENSE
README.md
mrbgem.rake
mruby-ngx-shadow_proxy.gem

README.md

HTTP shadow proxy for ngx_mruby.

install by mrbgems

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

    # ... (snip) ...

    conf.gem :github => 'ackintosh/mruby-ngx-shadow_proxy'
end

example

# nginx.conf
# mruby_log_handler /path/to/shadow_proxy.rb;

sp = ShadowProxy.new("example.com")

sp.on_backend_finished do |res|
  if res.code == 500
    Nginx.errlogger Nginx::LOG_ERR, "error!"
  end

  Nginx.errlogger Nginx::LOG_ERR, res.code
end

sp.run

License

under the MIT License: