Skip to content

Instantly share code, notes, and snippets.

@dlangille dlangille/nginx.conf
Created Nov 11, 2019

Embed
What would you like to do?
Poudriere configuration
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Allow gzipping js, css, log, svg and json files.
gzip on;
gzip_http_version 1.0;
gzip_comp_level 6;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
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;
}
sendfile on;
keepalive_timeout 65;
server {
listen 192.0.2.1:80;
listen [redacted]:80;
listen 192.0.2.1:443 ssl http2;
listen [redacted]:443 ssl http2;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_certificate /usr/local/etc/ssl/pkg01.int.unixathome.org.fullchain.cer;
ssl_certificate_key /usr/local/etc/ssl/pkg01.int.unixathome.org.key;
server_name pkg01.int.example.org;
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;
}
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;
}
location /packages {
root /usr/local/poudriere/data;
autoindex on;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
}
}
$ grep -i URL /usr/local/etc/poudriere.conf
# URL where your POUDRIERE_DATA/logs are hosted
# This will be used for giving URL hints to the HTML output when
URL_BASE=https://pkg01.int.example.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.