diff options
author | Adam T. Carpenter <atc@53hor.net> | 2021-02-09 16:35:28 -0500 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2021-02-09 16:35:28 -0500 |
commit | b40f65b7cbf1d746d1a3e80ed344c22fa78d36db (patch) | |
tree | 738212ddbb71dbf592dc5825a02ae71563040c52 | |
download | pkg-master.tar.xz pkg-master.zip |
-rw-r--r-- | Bastillefile | 8 | ||||
-rw-r--r-- | usr/local/etc/nginx/nginx.conf | 68 |
2 files changed, 76 insertions, 0 deletions
diff --git a/Bastillefile b/Bastillefile new file mode 100644 index 0000000..126cf4a --- /dev/null +++ b/Bastillefile @@ -0,0 +1,8 @@ +CMD mkdir -p /usr/local/share/poudriere +CMD mkdir -p /usr/local/poudriere/data +FSTAB /usr/local/share/poudriere usr/local/share/poudriere nullfs ro 0 0 +FSTAB /usr/local/poudriere/data usr/local/poudriere/data nullfs ro 0 0 +OVERLAY usr +PKG nginx +SYSRC nginx_enable=YES +SERVICE nginx start diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf new file mode 100644 index 0000000..b03ed4b --- /dev/null +++ b/usr/local/etc/nginx/nginx.conf @@ -0,0 +1,68 @@ +user nobody; +worker_processes auto; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + access_log /var/log/nginx/access.log; + sendfile on; + keepalive_timeout 65; + + # Allow gzipping js, css, log, svg and json files. + gzip on; + gzip_buffers 16 8k; + gzip_comp_level 6; + gzip_http_version 1.0; + gzip_min_length 1100; + gzip_proxied any; + gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/gif image/jpeg image/png application/json image/svg+xml; + + types { + text/plain log; + } + + server { + listen 80 default_server; + root /usr/local/share/poudriere/html; + + ## Allow caching static resources + location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|woff|css|js|html)$ { + add_header Cache-Control "public"; + expires 2d; + } + + ## pkg index + location /pkg { + autoindex on; + alias /usr/local/poudriere/data/packages; + } + + ## log data + location /data { + alias /usr/local/poudriere/data/logs/bulk; + + # Allow caching dynamic files but ensure they get rechecked + location ~* ^.+\.(log|txz|tbz|bz2|gz)$ { + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } + + # Don't log json requests as they come in frequently and ensure + # caching works as expected + location ~* ^.+\.(json)$ { + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + access_log off; + log_not_found off; + } + + # Allow indexing only in log dirs + location ~ /data/?.*/(logs|latest-per-pkg)/ { + autoindex on; + } + break; + } + } +} |