/docker-nginx-lua

🐳 Dockerized Nginx with modules "more_set_headers", "ngx_pagespeed" and "accept-language"

Primary LanguageDockerfileMIT LicenseMIT

Build Status License Docker Pulls

Docker Nginx

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. 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

Note

While this project is called "docker-nginx-lua" I've dropped the support for LuaJit, see #3

Examples

More Set Headers

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

Accept Language Module

server {   
    ...
    location ~ / {
        set_from_accept_language $lang en de;
        if ( $request_uri ~ ^/$  ) {
            rewrite ^/$ /$lang redirect;
            break;
        }
    }
    ...
}

Pagespeed

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

Author

Emanuele Mazzotta

License

FOSSA Status