Rewrite: modernize nginx config, fix healthcheck, multi-arch CI #5
Loading…
Reference in a new issue
No description provided.
Delete branch "(deleted):rewrite/modernize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR modernises the image, fixes a real bug in the healthcheck, and ships a few quality-of-life improvements.
Bug fix
HEALTHCHECKwas broken.nginx:alpinedoes not includecurl, so every container would have been reportedunhealthyregardless of nginx state. Switched to busyboxwget --spider, which is already in the image (no extra layer).Dockerfile
nginx:1.27-alpine(current stable major, renovate will track).org.opencontainers.image.*) so registries and tools can render metadata.VOLUME ["/assets", "/log"]JSON form (lint-cleaner).rm -rf /var/cache/apk/*(noapk addruns in this build)./log/access.logand/log/error.logandchownthem to thenginxuser so the running container can actually write to them when/logis a fresh volume mount.conf/nginx.confworker_processes auto;(was hardcoded to4).worker_connections 1024+multi_accept on.server_tokens off;so the nginx version is not leaked inServer:headers or error pages.gzip_vary,gzip_proxied,gzip_comp_level 6,gzip_min_length 1024, explicitgzip_types).gzip_disable "msie6";.conf/defaultlisten 80 default_server; listen [::]:80 default_server; server_name _;(explicit defaults + IPv6).charset utf-8;so directory listings render correctly.autoindex_exact_size off;(human-readable KB/MB/GB) andautoindex_localtime on;.try_files $uri $uri/ =404;so missing paths don't fall back to the autoindex of/..htaccess,.htpasswd,.env,.git) withdeny all; return 404;.CI / repo hygiene
.woodpecker.ymlnow builds for bothlinux/amd64andlinux/arm64..gitignorecovers JetBrains, macOS and Windows noise in addition to VS Code.renovate.jsonextendsconfig:recommendedand tells renovate to scan theDockerfile.Docs
README.mdnow documents the autoindex options, the healthcheck and how to override the server config.Verification
Built and ran locally with
docker build . && docker run -p 8081:80 -v /tmp/test-assets:/assets:ro docker-nginx-autoindex:test:/and/subdir/docker inspectreportsHealth.Status: healthynginx -tpasses🤖 This pull request was prepared by an AI agent on behalf of the repository owner.
cf72a45751to441a11782ePull request closed