{"id":24959037,"url":"https://github.com/waliot/logged-nginx","last_synced_at":"2026-04-18T00:01:52.607Z","repository":{"id":120645729,"uuid":"369629079","full_name":"waliot/logged-nginx","owner":"waliot","description":"The same NGINX but with logs compression, rotation and retention.","archived":false,"fork":false,"pushed_at":"2024-01-30T06:49:56.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T21:14:38.103Z","etag":null,"topics":["docker","hacktoberfest","hacktoberfest-accepted","logging","nginx","nginx-docker","nginx-log","nginx-logs"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/waliot/logged-nginx","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waliot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-21T18:59:31.000Z","updated_at":"2024-01-19T10:28:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"642eee93-3b80-40e5-8113-7a5a23400f47","html_url":"https://github.com/waliot/logged-nginx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/waliot/logged-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliot%2Flogged-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliot%2Flogged-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliot%2Flogged-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliot%2Flogged-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waliot","download_url":"https://codeload.github.com/waliot/logged-nginx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waliot%2Flogged-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","hacktoberfest","hacktoberfest-accepted","logging","nginx","nginx-docker","nginx-log","nginx-logs"],"created_at":"2025-02-03T07:46:01.180Z","updated_at":"2026-04-18T00:01:52.281Z","avatar_url":"https://github.com/waliot.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logged NGINX\n\nThe same `NGINX` but with logs compression, rotation and retention.\n\nEvery midnight new access and error log files start, the previous day's logs will be compressed. \nAll compressed logs older than one week will be deleted.\n\n## Getting started\n\nAll logs are stored in the directory `/var/log/nginx/`.\n\n* `/var/log/nginx/access.log` - current access logs\n\n* `/var/log/nginx/error.log` - current error logs\n\n* `/var/log/nginx/job.log` - logs of the cron job\n\n* `/var/log/nginx/archive/` - directory with compressed logs\n\n## Running via Docker\n\n### Start with `docker run`\n\n```bash\n$ docker build -t logged-nginx .\n$ docker volume create nginx_log\n$ docker run --name logged-nginx \\\n    --restart unless-stopped \\\n    -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf \\\n    -v nginx_log:/var/log/nginx \\\n    -p 80:80 \\\n    -d logged-nginx:latest\n```\n\n### Start with `docker-compose`\n\n```bash\n$ docker-compose build\n$ docker-compose up\n```\n\n### Some useful stuff\n\nCheck the `nginx` is working:\n\n```bash\n$ curl -X GET localhost:80\n\u003e Hello, World!\n```\n\nShow the cron job logs:\n\n```bash\n$ docker exec logged-nginx tail /var/log/nginx/job.log\n```\n\nSearch with `grep` in today's access logs:\n\n```bash\n$ docker exec logged-nginx grep '\"GET / HTTP/1.1\" 200' /var/log/nginx/access.log\n```\n\nSearch with `zgrep` in all archived logs:\n\n```bash\n$ docker exec logged-nginx bash -c 'find /var/log/nginx/archive/*.log.gz | xargs zgrep \"http://localhost/\"'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaliot%2Flogged-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaliot%2Flogged-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaliot%2Flogged-nginx/lists"}