Public | Automated Build

Last pushed: 7 months ago
Short Description
A Docker image with Nginx configured to act as a long caching proxy for HTTP requests.
Full Description

Nginx Caching Proxy Docker Container





A Docker image with Nginx configured to act as a long caching proxy for HTTP requests.

I use it while performing programming presentations with life coding sessions. It is especially useful when you do some frontend coding and have CDN dependencies in your HTML.

Inside the image

Sample usage

Start the container

docker run -d --name nginx-long-cache \
  -p 8787:8080 \
  -v $HOME/.nginx/longcache/log:/var/log/nginx \
  -v $HOME/.nginx/longcache/cache:/var/cache/nginx \
  mendlik/nginx-cache

Setup system wide network proxy for HTTP (Example for Ubuntu)

Test case

  1. Start the container
  2. Send twice the same HTTP request through the caching proxy.
    curl -I -x 'localhost:8787' 'http://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js'
    
    Second request should be cached and should contain following headers:
    X-Cached: HIT
    X-Cache-Server: mendlik/nginx-cache
    
Docker Pull Command
Owner
mendlik
Source Repository

Comments (0)