From d077dfdcf2ac4788bb971476e0e20f190de23b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Wed, 12 Jul 2023 20:34:00 +0200 Subject: [PATCH] Deploy a hello world openresty app --- site-cookbooks/kosmos_openresty/recipes/default.rb | 5 +++++ .../kosmos_openresty/templates/hello_world.conf.erb | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 site-cookbooks/kosmos_openresty/templates/hello_world.conf.erb diff --git a/site-cookbooks/kosmos_openresty/recipes/default.rb b/site-cookbooks/kosmos_openresty/recipes/default.rb index d2f6f03..ab845b1 100644 --- a/site-cookbooks/kosmos_openresty/recipes/default.rb +++ b/site-cookbooks/kosmos_openresty/recipes/default.rb @@ -5,3 +5,8 @@ # Install openresty from official packages include_recipe 'openresty::apt_package' + +openresty_site 'hello_world' do + template 'hello_world.conf.erb' + action :enable +end diff --git a/site-cookbooks/kosmos_openresty/templates/hello_world.conf.erb b/site-cookbooks/kosmos_openresty/templates/hello_world.conf.erb new file mode 100644 index 0000000..cf14959 --- /dev/null +++ b/site-cookbooks/kosmos_openresty/templates/hello_world.conf.erb @@ -0,0 +1,9 @@ +server { + listen 80 reuseport; + location / { + default_type text/plain; + content_by_lua_block { + ngx.say("Hello World") + } + } +}