Skip to content

a Docker image to use Nginx as an HTTP(S) proxy to cache static assets.

Notifications You must be signed in to change notification settings

ahdinosaur/http-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-cache

a Docker image to use Nginx as an HTTP(S) proxy to cache static assets.

caveat emptor: can only do insecure HTTPS proxying

helpful when you need to repeatedly install packages from apt-get, npm, cargo, etc.

inspiration from:

usage

first, download the Docker image:

docker pull ahdinosaur/http-cache

then run it as:

docker run -it --rm \
  -p 3142:3142 \
  -v "$(pwd)/cacher/log:/var/log/nginx" \
  -v "$(pwd)/cacher/data:/var/cache/nginx" \
  ahdinosaur/http-cache

notice you will need the volumes mounted to:

  • /var/log/nginx: the nginx logs (cache_access.log)
  • /var/cache/nginx: the nginx cache data

to test it works:

curl -I --proxy 'http://localhost:3142' 'https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js'

license

The Apache License

Copyright © 2018 Michael Williams

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

a Docker image to use Nginx as an HTTP(S) proxy to cache static assets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published