gx_ruby
gx_ruby是嵌入ruby脚本的Ngix模块。
环境ruby-2.3.*
gix-1.6.3+
安装$ git cloe https://github.com/rryqszq4/gx_ruby.git$ wget 'https://gix.org/dowload/gix-1.6.3.tar.gz'$ tar -zxvf gix-1.6.3.tar.gz$ cd gix-1.6.3$ export RUBY_INC=/path/to/ruby/iclude/ruby-2.3.0$ export RUBY_LIB=/path/to/ruby/lib$ ./cofigure --user=www --group=www \ --prefix=/path/to/gix \ --add-module=/path/to/gx_ruby$ make$ make istall摘要gixcofig:
user www www;worker_processes 4;evets { worker_coectios 1024;}http { iclude mime.types; default_type applicatio/octet-stream; keepalive_timeout 65; server { liste 80; server_ame localhost; locatio /cotet_by_ruby { cotet_by_ruby " time1 = Time.ew Ngx.prit('Hello, Ngx_ruby. Curret Time : ' + time1.ispect); "; } locatio /cotet_by_ruby_file { cotet_by_ruby_file /gx_ruby/t/library/hello.rb; } }}
评论