Skip to content

tofran/nginx-with-substitutions-filter-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Nginx Docker image with substitutions filter module

Build and deploy Docker Image Size (latest semver) Docker Pulls

Slim Nginx, multi-arch alpine Docker image with substitution filter module.

The final result is a clean image completely based on the official nginx:alpine. Does not contain any compile time junk, the only additions are:

  • Dynamic module inserted at /usr/lib/nginx/modules/ngx_http_subs_filter_module.so;
  • Importing of the module in /etc/nginx/nginx.conf with load_module.

Available on DockerHub and on GitHub container registry:

docker pull tofran/nginx-with-substitutions-filter
# or
docker pull ghcr.io/tofran/nginx-with-substitutions-filter

This repo could also be helpful as a recipe for building images with any other dynamic modules, or even as way to extract compiled binaries from them.

Example usage

Create the following example configuration ./sample.conf:

server {
    listen 80;

    location / {
        subs_filter_types text/html text/css text/xml application/javascript;
        subs_filter "nginx" "replaced";
        root /usr/share/nginx/html;
    }
}

Now run the image:

docker run -p 8080:80 -v ./sample.conf:/etc/nginx/conf.d/default.conf tofran/nginx-with-substitutions-filter

Visit http://localhost:8080:

screenshot

There you go, you now have a nginx running with on-the-fly string replacement. Happy replacing!

License

MIT

About

🐳 Slim Nginx Docker image with substitutions filter module (ngx_http_sub_module)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •