{"id":43834002,"url":"https://github.com/robertbruno/nginx-docker","last_synced_at":"2026-02-06T03:34:51.667Z","repository":{"id":253865709,"uuid":"770050550","full_name":"robertbruno/nginx-docker","owner":"robertbruno","description":"custom nginx docker + certbot \u0026\u0026 aws cli","archived":false,"fork":false,"pushed_at":"2024-12-07T16:43:32.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-07T17:28:26.290Z","etag":null,"topics":["aws","aws-cli","certbot","letsencrypt","nginx","webhookd"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertbruno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-10T19:27:54.000Z","updated_at":"2024-12-07T16:43:36.000Z","dependencies_parsed_at":"2024-08-20T03:47:18.737Z","dependency_job_id":"b6e75334-e4ba-4287-a88b-5163d076a563","html_url":"https://github.com/robertbruno/nginx-docker","commit_stats":null,"previous_names":["robertbruno/nginx-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertbruno/nginx-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertbruno%2Fnginx-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertbruno%2Fnginx-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertbruno%2Fnginx-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertbruno%2Fnginx-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertbruno","download_url":"https://codeload.github.com/robertbruno/nginx-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertbruno%2Fnginx-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29148431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["aws","aws-cli","certbot","letsencrypt","nginx","webhookd"],"created_at":"2026-02-06T03:34:51.572Z","updated_at":"2026-02-06T03:34:51.654Z","avatar_url":"https://github.com/robertbruno.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx docker\n\nThis project maintains an nginx docker image to cover basic needs, such as a load balancer or distributed proxy pass for:\n\n* Expose services and applications based on their domain names.\n* Manage multiple domains (if necessary). Similar to \"virtual hosts\".\n* Enable HTTPS and automatically generate certificates (including renewals) with Let's Encrypt.\n* Add HTTP Basic Auth for any services you need to protect that don't have their own security, etc.\n\n## Build\n\n```bash\ndocker build -t nginx-docker -f Dockerfile .\n```\n\n## Config\n\nThe nginx configuration is located in the file [nginx.conf](nginx.conf).\n\n\u003e For more info:\n\u003e\n\u003e * [www.nginx.com](https://www.nginx.com/resources/wiki/start/topics/examples/full/)\n\n\n## Run\n\n```bash\ndocker run --rm --name  nginx -p 80:80 -p 443:443 \\\n    -e  DOMAIN=dominio.com \\\n    nginx-docker\n```\n\n## Check it\n\n* Check if the stack was deployed with:\n\n```bash\ndocker stack ps nginx\n```\n\n## Logs\n\nYou can consult Nginx logs by running the following command line on any swarm cluster node:\n\n```bash\ndocker logs -f  --tail 100 nginx\n```\n\n## Utils\n\nInside the `resources/utils` folder there are several files that will help you configure different features in nginx, for example:\n\n* **[gzip](resources/utils/gzip)** It has the necessary instructions to enable gzip compression on the indicated domain.\n* **[host](resources/utils/host)** Allows you to enable the replication of certain headers such as the host.\n\n## Webhookd\n\nA very simple webhook server to launch shell scripts.\n\nIn this image we include this tool to have a simple administration and control mechanism, for example to update letsencrypt certificates, enable or disable configurations\n\nYou can use the following environment variables to configure:\n\n* WHD_PASSWD_FILE (default: `/etc/webhookd/users.htpasswd`)\n* WHD_USER\n* WHD_PASSWD\n\n### built-in scripts\n\nIn this docker image we include some scripts that will allow you basic administration of some elements, for example run cerbot to create certificates or enable or disable configurations\n\nYou can use the following environment variables to configure:\n\n*  DEFAULT_MAIL\n\n* **certbot** \n\nIt will execute the certbot command line to generate a new certificate for the indicated domain. Additionally, if the appropriate environment variables have been defined, it will upload said certificate to AWS.\n\n```bash\ncurl http://localhost:8080/certbot?domain=foo.com\u0026mail=foo@mail.com\n```\n\n\u003e the mail parameter overwrites the value of the **DEFAULT_MAIL**  variable\n\n* **cercertbot-renew** \n\nIt will execute the certbot command line to update certificate for the indicated domain. Additionally, if the appropriate environment variables have been defined, it will upload said certificate to AWS.\n\n```bash\ncurl http://localhost:8080/cercertbot-renew?domain=foo.com\u0026mail=foo@mail.com\n```\n\n\u003e the mail parameter overwrites the value of the **DEFAULT_MAIL**  variable\n\n* **cerccertbot-cli** \n\nList locally installed letsencrypt certificates\n\n```bash\ncurl http://localhost:8080/certbot-cli\n```\n\n* **nginx-find-conf**\n\nYou can check the available nginx configuration\n\n```bash\ncurl http://localhost:8080/nginx-find-conf\n```\n\n* **nginx-enable-conf**\n\nAllows to enable an nginx configuration file\n\n```bash\ncurl http://localhost:8080/nginx-enable-conf\n```\n\u003e For the changes to take effect it is recommended to have a volume in the container and restart the nginx service\n\n* **nginx-disable-conf**\n\nAllows to disable an nginx configuration file\n\n```bash\ncurl http://localhost:8080/nx-disable-conf\n```\n\n\u003e For the changes to take effect it is recommended to have a volume in the container and restart the nginx service\n\n## AWS cli\n\nThe AWS Command Line Interface (AWS CLI) is a unified tool for managing AWS services. You only need to download and configure a single tool to control multiple AWS services from the command line and automate them using scripts.\n\nIn this image we include this tool to have a simple integration mechanism to, for example, upload letsencrypt certificates to AWS\n\nYou can use the following environment variables to configure:\n\n*  AWS_REGION (default `us-east-1`)\n*  AWS_ACCESS_KEY_ID\n*  AWS_SECRET_ACCESS_KEY\n*  ALB_ARN\n*  ALB_LISTENER_PORT (default `443`)\n*  TARGET_GROUP_ARN\n\n## Using environment variables in nginx configuration\n\nOut-of-the-box, nginx doesn't support environment variables inside most configuration blocks. But this image has a function, which will extract environment variables before nginx starts.\n\nHere is an example using docker-compose.yml:\n\n```yaml\nweb:\n  image: nginx\n  volumes:\n   - ./templates:/etc/nginx/templates\n  ports:\n   - \"8080:80\"\n  environment:\n   - NGINX_HOST=foobar.com\n   - NGINX_PORT=80\n```\n\nBy default, this function reads template files in `/etc/nginx/templates/*.template` and outputs the result of executing envsubst to `/etc/nginx/conf.d`.\n\nSo if you place `templates/default.conf.template` file, which contains variable references like this:\n\n```\nlisten       ${NGINX_PORT};\n```\n\noutputs to `/etc/nginx/conf.d/default.conf` like this:\n\n```\nlisten       80;\n```\n\n\u003e Directory which contains template files by default is `/etc/nginx/templates`. For more info:\n\u003e\n\u003e * [Nginx Docker Official Image](https://hub.docker.com/_/nginx)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertbruno%2Fnginx-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertbruno%2Fnginx-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertbruno%2Fnginx-docker/lists"}