Skip to content

emazzotta/docker-nginx-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

151 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status License Docker Pulls

Docker Nginx LuaJIT

Nginx compiled from source with LuaJIT, lua-nginx-module, headers-more, and nginx_accept_language_module.

Usage

docker run -v <my_conf_dir>:/etc/nginx/conf.d -p 80:80 emazzotta/docker-nginx-lua

Or with Docker Compose:

docker compose up

Example

The example/conf.d/default.conf combines all modules in a single server block:

server {
    listen 80;
    server_name _;

    location / {
        set_from_accept_language $lang en de fr;
        more_set_headers 'X-Detected-Language: $lang';

        default_type text/plain;
        content_by_lua_block {
            ngx.say("It works - docker-nginx-lua: OK [" .. ngx.var.lang .. "]")
        }
    }
}

Test it:

curl -H "Accept-Language: de" http://localhost:8080
# It works - docker-nginx-lua: OK [de]
# Header: X-Detected-Language: de

Author

Emanuele Mazzotta

License

FOSSA Status

About

🐳 Dockerized Nginx with modules "more_set_headers", "accept-language", etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors