2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/maintenance.git synced 2023-12-14 03:33:04 +01:00
maintenance/hydra/nginx/mirror.conf
2016-03-10 16:41:48 +01:00

82 lines
2.2 KiB
Text

# This is the /etc/nginx/nginx.conf file for mirrors.
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;
lock_file /var/lock/nginx.lock;
pcre_jit on;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
client_body_temp_path /var/lib/nginx/body;
proxy_temp_path /var/lib/nginx/proxy;
access_log /var/log/nginx/access.log;
sendfile on;
# Maximum chunk size to send. Partly this is a workaround
# for <http://bugs.gnu.org/19939>, but also the nginx docs
# mention that "Without the limit, one fast connection may
# seize the worker process entirely."
# <http://nginx.org/en/docs/http/ngx_http_core_module#sendfile_max_chunk>
sendfile_max_chunk 1m;
keepalive_timeout 65;
# cache for narinfo files
proxy_cache_path /var/cache/nginx/narinfo
levels=2
inactive=7d # inactive keys removed after 7d
keys_zone=narinfo:8m # narinfo meta data: ~64K keys
max_size=4g; # total cache data size max
# cache for nar files
proxy_cache_path /var/cache/nginx/nar
levels=2
inactive=7d # inactive keys removed after 7d
keys_zone=nar:8m # nar cache meta data: ~64K keys
max_size=100g; # total cache data size max
# cache for static data
proxy_cache_path /var/cache/nginx/static
levels=1
inactive=7d # inactive keys removed after 7 days
keys_zone=static:1m # nar cache meta data: ~8K keys
max_size=2m; # total cache data size max
server {
listen 80;
server_name hydra.gnu.org;
access_log /var/log/nginx/hydra.access.log;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include mirror-locations.conf;
}
server {
listen 443 ssl;
server_name hydra.gnunet.org;
keepalive_timeout 70;
access_log /var/log/nginx/hydra.https.access.log;
ssl_certificate /etc/letsencrypt/live/hydra.gnunet.org/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/hydra.gnunet.org/privkey.pem;
include mirror-locations.conf;
}
}