diff options
author | saurabhb17 | 2020-02-26 15:57:49 +0530 |
---|---|---|
committer | saurabhb17 | 2020-02-26 15:57:49 +0530 |
commit | aa35045840b78d3f48212db45da59a2e5c69b223 (patch) | |
tree | 6acee185a4dc19113fcbf0f9a3d6941085dedaf7 /pcbnew/github/nginx.conf | |
parent | 0db48f6533517ecebfd9f0693f89deca28408b76 (diff) | |
download | KiCad-eSim-aa35045840b78d3f48212db45da59a2e5c69b223.tar.gz KiCad-eSim-aa35045840b78d3f48212db45da59a2e5c69b223.tar.bz2 KiCad-eSim-aa35045840b78d3f48212db45da59a2e5c69b223.zip |
Added main execs
Diffstat (limited to 'pcbnew/github/nginx.conf')
-rw-r--r-- | pcbnew/github/nginx.conf | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pcbnew/github/nginx.conf b/pcbnew/github/nginx.conf new file mode 100644 index 0000000..24f3320 --- /dev/null +++ b/pcbnew/github/nginx.conf @@ -0,0 +1,64 @@ +# Author: <Dick Hollenbeck> dick@softplc.com +# Configuration file for nginx. Nginx works as a nice cache-ing proxy for +# the github footprint repos in a local nginx instance. + + +# In my case I also added a small RAM disk on a linux server to hold the cache. +# This line in /etc/fstab adds my RAM disk, this is 10 mbytes but 5mb would +# probably suffice: +none /var/cache/nginx tmpfs size=10m + +# I then set my KIGITHUB environment variable to +# export KIGITHUB=http://my_server:54321/KiCad + +# Note that http is used between kicad and nginx, not https. However nginx uses +# https when refreshing from github. http is faster than https. + +# You can run nginx either on your local machine, or on a server on your network, +# or a server on the Internet. In my case I run it on my network. I imagine +# that even a Raspery Pi would act as a decent caching server so long as you +# install nginx and give the machine Internet access. + + +worker_processes 2; + +events { + worker_connections 1024; +} + + +http { + proxy_cache_path /var/cache/nginx keys_zone=cache_zone:10m; + + server { + # nginx will listen on this port: + listen 54321; + + proxy_cache cache_zone; + + # hold the stuff for one week, then mark it as out of date which will + # cause it to be reloaded from github. + proxy_cache_valid 1w; + + location /KiCad/ { + rewrite /KiCad/(.+) /KiCad/$1/zip/master break; + + # Skip past the redirect issued by https://github.com + proxy_pass https://codeload.github.com; + + proxy_set_header Proxy-Connection "Keep-Alive"; + + proxy_ignore_headers "Set-Cookie"; + proxy_ignore_headers "Cache-Control"; + proxy_ignore_headers "Expires"; + + proxy_cache_bypass $http_secret_header; + + add_header X-Cache-Status $upstream_cache_status; + + # This line causes github.com to return a "502 Bad Gateway Error" + # so do not include it: + # proxy_set_header Host $http_host; + } + } +} |