🐳 Dockerized Nginx with modules "more_set_headers", "ngx_pagespeed" and Lua
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hooks
.gitignore
.gitlab-ci.yml
Dockerfile
LICENSE.md
README.md
mime.types
nginx.conf

README.md

License Docker Pulls Docker Layers Docker Version Tag Docker Commit FOSSA Status

Docker Nginx Lua

A Docker project for a recent version of the Nginx webserver and the module more_set_headers to specify custom headers such as a server name like 1337-server instead of nginx or apache. This also contains LuaJIT so that lua can be used in nginx configurations. Another module this nginx build contains is Google's ngx_pagespeed module

Usage

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

Examples

More Set Headers

http {
    ...
    more_set_headers 'Server: 1337-server';
    ...
}

Lua

server {   
    ...
    location ~ / {
        rewrite_by_lua '
        for lang in (ngx.var.http_accept_language .. ","):gmatch("([^,]*),") do
            if string.sub(lang, 0, 2) == "en" then
                ngx.redirect("/en/")
            end
            if string.sub(lang, 0, 2) == "de" then
                ngx.redirect("/de/")
            end
        end
        ngx.redirect("/en/")';
    }
    ...
}

Pagespeed

server {
    ...
    pagespeed on;
    pagespeed FileCachePath /var/cache/nginx;
    pagespeed XHeaderValue "Pagespeed";
    pagespeed RewriteLevel CoreFilters;
    ...
}

Author

Emanuele Mazzotta

License

FOSSA Status