Created
February 8, 2021 10:40
-
-
Save mizhka/a373eca3c7ccdc3aed1c1d024ae38761 to your computer and use it in GitHub Desktop.
poudriere behind reverse proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place these sections into the relevant nginx.conf or included files sections. | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# 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; | |
} | |
server { | |
include mime.types; | |
listen 80; | |
root /usr/local/share/nginx; | |
location /poudriere/ { | |
alias /usr/local/share/poudriere/html/; | |
index index.html; | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|woff|css|js|html)$ { | |
add_header Cache-Control "public"; | |
expires 2d; | |
} | |
location /poudriere/data/ { | |
alias /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; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment