Created
April 14, 2020 20:03
-
-
Save jasonrm/d1690232a4352ed7aab508bf8c5a05e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 4096; | |
upstream ARCH_LINUX_MIRRORS { | |
# server mirror.lty.me; | |
# server mirrors.ocf.berkeley.edu; | |
server mirror.arizona.edu; | |
# server mirrors.xmission.com; | |
# server mirrors.xtom.com; | |
# server mirrors.lug.mtu.edu; | |
# server mirrors.acm.wpi.edu; | |
} | |
proxy_cache_path /var/cache/nginx | |
levels=1:2 | |
keys_zone=ARCH_LINUX_CACHE:10m | |
inactive=7d | |
use_temp_path=off | |
max_size=5g; | |
server { | |
listen 8081; | |
# Cache packages and other archives | |
location ~ (\.pkg\.tar\.xz|\.tar\.gz)$ { | |
client_body_buffer_size 1m; | |
client_max_body_size 250m; | |
proxy_buffers 32 4k; | |
proxy_cache ARCH_LINUX_CACHE; | |
proxy_cache_valid 365d; | |
proxy_connect_timeout 900; | |
proxy_ignore_headers X-Accel-Expires Expires Cache-Control; | |
proxy_pass http://ARCH_LINUX_MIRRORS; | |
proxy_read_timeout 900; | |
proxy_redirect off; | |
proxy_send_timeout 900; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
location / { | |
proxy_pass http://ARCH_LINUX_MIRRORS; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment