Public | Automated Build

Last pushed: 6 months ago
Short Description
A simple docker container with nginx, the headers more, the lua and the nginx development modules
Full Description



Docker Nginx More Headers + 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 thing that this nginx build contains is Google's ngx_pagespeed module

Link to Dockerhub: https://hub.docker.com/r/emazzotta/docker-nginx-more-headers-lua/

Examples

More Set Headers

In your nginx.conf.

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

Lua

In your site configuration e.g. for automatic language based redirecting.

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

MIT License © Emanuele Mazzotta

Docker Pull Command
Owner
emazzotta

Comments (0)