Nginx in AMIMOTO AMI now supports ngx_mruby dynamic module version.
By introducing the ngx_mruby, you can configure nginx much more flexibly.
If you want to launch new AMIMOTO AMI with ngx_mruby, simply specify the below shell script as User Data when launching.
https://gist.github.com/wokamoto/ce147a09f4fe5832bb4d5f4e1f7cc2b9
When launching AMIMOTO AMI, it runs chef recipe.
Chef calls configuration file placed in /opt/local/amimoto.json
and changes configurations of nginx with high flexibility based on it.
By specifying the above shell script as a User Data, cloud-init rewrites amimoto.json file and install the ngx_mruby to AMIMOTO AMI, by specifying the above shell script as a User Data.
To install nix_mruby into your running current AMIMOTO AMI, just run single line shell script:
$ sudo bash -ex -c "$(curl -s https://gist.githubusercontent.com/wokamoto/e1e1495737dd1924588c042c423b7486/raw/8b457091d875980627bc90d2a0d2cd86f325a564/gistfile1.txt)"
However, some older version of AMIMOTO AMI, it does not take effect.
To check your AMI supports ngx_mruby, run the following check command:
$ git -C /opt/local/chef-repo/cookbooks/amimoto/ branch
* 2016.01
AMIMOTO AMI returns “2016.01” in the branch, your instance supports ngx_mruby.
If your instance returns older than “2016.01”, it does not support ngx_mruby, so create new instance with latest AMIMOTO AMI.