Skip to content

Instantly share code, notes, and snippets.

@lalyos
Created June 28, 2018 09:15
Show Gist options
  • Save lalyos/59c762323c217bc36fec5e1cb191a2fb to your computer and use it in GitHub Desktop.
Save lalyos/59c762323c217bc36fec5e1cb191a2fb to your computer and use it in GitHub Desktop.
openresty lua sample docker

use openresty/openresty:alpine as a base image it has an /etc/nginx/conf.d/ dir

    location /lua {                                                                                    
      content_by_lua '                                                                                 
        ngx.say("hello from lua")                                                                      
        ngx.say("host: ", os.getenv("HOSTNAME"))                                                       
      ';                                                                                               
    }                                                                                                  

to propagate env vars, add env directive to the main context of /usr/local/openresty/nginx/conf/nginx.conf

env HOSTNAME;
env PATH;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment