FreeBSD/jails/config/pkgp/nginx.conf
Sharad Ahlawat 90c5709862 .
2021-04-01 01:23:14 -07:00

197 lines
5.4 KiB
Nginx Configuration File

user www wheel;
worker_processes 8;
error_log /var/log/nginx/error.log;
events {
}
http {
include mime.types;
default_type application/octet-stream;
# access_log /var/log/nginx/access.log;
access_log off;
sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
aio 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;
server_name pkgp.ahlawat.com;
root /usr/local/share/poudriere/html;
location /data {
alias /mnt/poudriere/data/logs/bulk;
autoindex on;
}
location /packages {
root /mnt/poudriere/data;
autoindex on;
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
}
server {
listen *:443 ssl;
listen [::]:443 ssl;
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_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location /data {
alias /mnt/poudriere/data/logs/bulk;
autoindex on;
}
location /packages {
root /mnt/poudriere/data;
autoindex on;
}
#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;
server {
listen *:80;
listen [::]:80;
server_name pkgp-freebsd-pkg.ahlawat.com;
root /mnt/cache/pkg/;
autoindex on;
if_modified_since before;
location / {
proxy_cache pkg_cache;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_next_upstream error timeout invalid_header http_404;
proxy_pass http://pkg-mirrors;
proxy_http_version 1.1;
# add_header X-Proxy-Cache $upstream_cache_status;
}
}
upstream pkg-mirrors {
server localhost:8001;
server localhost:8002 backup;
server localhost:8003 backup;
}
server {
listen *:8001;
listen [::]:8001;
server_name localhost;
location / {
proxy_pass http://pkg0.isc.FreeBSD.org;
}
}
server {
listen *:8002;
listen [::]:8002;
server_name localhost;
location / {
proxy_pass http://pkg0.tuk.FreeBSD.org;
}
}
server {
listen *:8003;
listen [::]:8003;
server_name localhost;
location / {
proxy_pass http://pkg0.nyi.FreeBSD.org;
}
}
proxy_cache_path /mnt/cache/update/ levels=1:2 keys_zone=update_cache:10m max_size=10g inactive=10d use_temp_path=off;
server {
listen *:80;
listen [::]:80;
server_name pkgp-freebsd-update.ahlawat.com;
root /mnt/cache/update/;
if_modified_since before;
location / {
proxy_cache update_cache;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_next_upstream error timeout invalid_header http_404;
proxy_pass http://update-mirrors;
proxy_http_version 1.1;
# add_header X-Proxy-Cache $upstream_cache_status;
}
}
upstream update-mirrors {
keepalive 4;
server localhost:8011;
server localhost:8012;
server localhost:8013;
server localhost:8014;
}
server {
listen *:8011;
listen [::]:8011;
server_name localhost;
location / {
proxy_pass http://update1.FreeBSD.org;
}
}
server {
listen *:8012;
listen [::]:8012;
server_name localhost;
location / {
proxy_pass http://update2.FreeBSD.org;
}
}
server {
listen *:8013;
listen [::]:8013;
server_name localhost;
location / {
proxy_pass http://update5.FreeBSD.org;
}
}
server {
listen *:8014;
listen [::]:8014;
server_name localhost;
location / {
proxy_pass http://update4.FreeBSD.org;
}
}
}