apr 19 update
This commit is contained in:
@ -1,28 +1,24 @@
|
||||
user www wheel;
|
||||
worker_processes 8;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# access_log /var/log/nginx/access.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
access_log off;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
sendfile on;
|
||||
sendfile_max_chunk 512k;
|
||||
tcp_nopush on;
|
||||
aio on;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
|
||||
resolver 192.168.0.5 [fd01::5];
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
server {
|
||||
listen *:80;
|
||||
listen [::]:80;
|
||||
@ -40,7 +36,6 @@ http {
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/local/www/nginx-dist;
|
||||
@ -48,18 +43,31 @@ http {
|
||||
}
|
||||
|
||||
server {
|
||||
listen *:443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
listen *:443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name pkgp.ahlawat.com;
|
||||
root /usr/local/share/poudriere/html;
|
||||
|
||||
ssl_certificate /mnt/certs/fullchain.pem;
|
||||
ssl_certificate_key /mnt/certs/privkey.pem;
|
||||
|
||||
ssl_session_cache shared:SSL:1m;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
|
||||
ssl_session_tickets off;
|
||||
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
ssl_prefer_server_ciphers on;
|
||||
# modern configuration
|
||||
ssl_protocols TLSv1.3;
|
||||
ssl_prefer_server_ciphers off;
|
||||
|
||||
# HSTS (ngx_http_headers_module is required) (63072000 seconds)
|
||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||
|
||||
# OCSP stapling
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
# verify chain of trust of OCSP response using Root CA and Intermediate certs
|
||||
ssl_trusted_certificate /mnt/certs/fullchain.pem;
|
||||
|
||||
location /data {
|
||||
alias /mnt/poudriere/data/logs/bulk;
|
||||
@ -72,31 +80,43 @@ http {
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/local/www/nginx-dist;
|
||||
}
|
||||
}
|
||||
|
||||
proxy_cache_path /mnt/cache/pkg/ levels=1:2 keys_zone=pkg_cache:10m max_size=10g inactive=10d use_temp_path=off;
|
||||
# https://www.nginx.com/blog/nginx-caching-guide/
|
||||
# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid
|
||||
|
||||
proxy_cache_path /mnt/cache/pkg/ levels=1:2 keys_zone=pkg_cache:10m max_size=10g inactive=1d use_temp_path=off;
|
||||
|
||||
server {
|
||||
listen *:80;
|
||||
listen [::]:80;
|
||||
server_name pkgp-freebsd-pkg.ahlawat.com;
|
||||
root /mnt/cache/pkg/;
|
||||
autoindex on;
|
||||
if_modified_since before;
|
||||
# root /mnt/cache/pkg/;
|
||||
# autoindex on;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_socket_keepalive on;
|
||||
proxy_set_header Host $host;
|
||||
# add_header X-Proxy-Cache $upstream_cache_status;
|
||||
|
||||
location / {
|
||||
proxy_cache pkg_cache;
|
||||
proxy_cache_valid 1d;
|
||||
proxy_cache_revalidate on;
|
||||
proxy_cache_lock on;
|
||||
proxy_next_upstream error timeout invalid_header http_404;
|
||||
|
||||
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
|
||||
proxy_hide_header X-Accel-Expires;
|
||||
proxy_hide_header Expires;
|
||||
proxy_hide_header Cache-Control;
|
||||
proxy_hide_header Set-Cookie;
|
||||
|
||||
proxy_pass http://pkg-mirrors;
|
||||
proxy_http_version 1.1;
|
||||
# add_header X-Proxy-Cache $upstream_cache_status;
|
||||
proxy_next_upstream error timeout invalid_header http_404;
|
||||
}
|
||||
}
|
||||
upstream pkg-mirrors {
|
||||
@ -110,7 +130,7 @@ http {
|
||||
listen [::]:8001;
|
||||
server_name localhost;
|
||||
location / {
|
||||
proxy_pass http://pkg0.isc.FreeBSD.org;
|
||||
proxy_pass http://pkg0.tuk.FreeBSD.org;
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +139,7 @@ http {
|
||||
listen [::]:8002;
|
||||
server_name localhost;
|
||||
location / {
|
||||
proxy_pass http://pkg0.tuk.FreeBSD.org;
|
||||
proxy_pass http://pkg0.bbt.FreeBSD.org;
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,27 +152,38 @@ http {
|
||||
}
|
||||
}
|
||||
|
||||
proxy_cache_path /mnt/cache/update/ levels=1:2 keys_zone=update_cache:10m max_size=10g inactive=10d use_temp_path=off;
|
||||
|
||||
proxy_cache_path /mnt/cache/update/ levels=1:2 keys_zone=update_cache:10m max_size=10g inactive=1d use_temp_path=off;
|
||||
|
||||
server {
|
||||
listen *:80;
|
||||
listen [::]:80;
|
||||
server_name pkgp-freebsd-update.ahlawat.com;
|
||||
root /mnt/cache/update/;
|
||||
if_modified_since before;
|
||||
# root /mnt/cache/update/;
|
||||
# autoindex on;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_socket_keepalive on;
|
||||
proxy_set_header Host $host;
|
||||
# add_header X-Proxy-Cache $upstream_cache_status;
|
||||
|
||||
location / {
|
||||
proxy_cache update_cache;
|
||||
proxy_cache_valid 1d;
|
||||
proxy_cache_revalidate on;
|
||||
proxy_cache_lock on;
|
||||
proxy_next_upstream error timeout invalid_header http_404;
|
||||
|
||||
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
|
||||
proxy_hide_header X-Accel-Expires;
|
||||
proxy_hide_header Expires;
|
||||
proxy_hide_header Cache-Control;
|
||||
proxy_hide_header Set-Cookie;
|
||||
|
||||
proxy_pass http://update-mirrors;
|
||||
proxy_http_version 1.1;
|
||||
# add_header X-Proxy-Cache $upstream_cache_status;
|
||||
proxy_next_upstream error timeout invalid_header http_404;
|
||||
}
|
||||
}
|
||||
upstream update-mirrors {
|
||||
keepalive 4;
|
||||
server localhost:8011;
|
||||
server localhost:8012;
|
||||
server localhost:8013;
|
||||
@ -193,4 +224,5 @@ http {
|
||||
proxy_pass http://update4.FreeBSD.org;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user