|
@@ -14,7 +14,7 @@ http {
|
|
|
# https://github.com/matsumoto-r/ngx_mruby/wiki/Class-and-Method#nginxrequest-class
|
|
|
|
|
|
# db connection pool
|
|
|
- mruby_init_worker_code 'Userdata.new("my_#{Process.pid}").db = MySQL::Database.new("localhost", "root", "", "benchmark")';
|
|
|
+ mruby_init_worker_code 'Userdata.new("my_#{Process.pid}").db = MySQL::Database.new("DBHOSTNAME", "root", "", "benchmark")';
|
|
|
mruby_exit_worker_code 'db = Userdata.new("my_#{Process.pid}").db ; db.close if db';
|
|
|
server {
|
|
|
listen 8000;
|
|
@@ -37,17 +37,17 @@ http {
|
|
|
|
|
|
location ~ /db {
|
|
|
default_type "application/json";
|
|
|
- mruby_content_handler '/usr/local/nginx-1.4.7mruby/html/db.rb' cache;
|
|
|
+ mruby_content_handler 'CWD/nginx_mruby/db.rb' cache;
|
|
|
}
|
|
|
|
|
|
location ~ /queries {
|
|
|
default_type "application/json";
|
|
|
- mruby_content_handler '/usr/local/nginx-1.4.7mruby/html/queries.rb' cache;
|
|
|
+ mruby_content_handler 'CWD/nginx_mruby/queries.rb' cache;
|
|
|
}
|
|
|
|
|
|
location ~ /fotunes {
|
|
|
default_type "application/html";
|
|
|
- mruby_content_handler '/usr/local/nginx-1.4.7mruby/html/fotunes.rb' cache;
|
|
|
+ mruby_content_handler 'CWD/nginx_mruby/fotunes.rb' cache;
|
|
|
}
|
|
|
|
|
|
|