{"id":15513138,"url":"https://github.com/heroku/heroku-buildpack-nginx","last_synced_at":"2025-10-03T18:20:56.405Z","repository":{"id":37251643,"uuid":"44764319","full_name":"heroku/heroku-buildpack-nginx","owner":"heroku","description":"Classic buildpack that installs nginx.","archived":false,"fork":false,"pushed_at":"2024-08-30T16:22:01.000Z","size":171102,"stargazers_count":247,"open_issues_count":26,"forks_count":789,"subscribers_count":95,"default_branch":"main","last_synced_at":"2024-12-27T05:06:20.768Z","etag":null,"topics":[],"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/heroku.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","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":"2015-10-22T18:14:02.000Z","updated_at":"2024-11-26T09:16:29.000Z","dependencies_parsed_at":"2024-05-28T12:14:56.943Z","dependency_job_id":"059f9355-a2b8-4ed8-bf32-f02ca6e54e76","html_url":"https://github.com/heroku/heroku-buildpack-nginx","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fheroku-buildpack-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fheroku-buildpack-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fheroku-buildpack-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fheroku-buildpack-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heroku","download_url":"https://codeload.github.com/heroku/heroku-buildpack-nginx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236196794,"owners_count":19110784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-02T09:54:06.925Z","updated_at":"2025-10-03T18:20:56.304Z","avatar_url":"https://github.com/heroku.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Heroku Buildpack: Nginx\n\nNginx-buildpack installs \u0026 runs the [Nginx web server](https://nginx.org/) inside a Heroku app.\n\n## Features\n\n* Presets for specific use-cases\n\t- [Static sites](static.md)\n\t- [Local proxy to app servers](proxy.md)\n* Complete control of Nginx config in `config/nginx.conf.erb`\n\t- [`erb` template](https://github.com/ruby/erb) supports dynamic config at start-up\n\t- see [Nginx docs](https://nginx.org/en/docs/)\n* writes [Heroku request ids](https://devcenter.heroku.com/articles/http-request-id) \u0026 server timing to access logs\n\n\n### Nginx versions\n\nThese are auto-selected based on the app's stack at build time.\n\n| Heroku Stack | Nginx Version | PCRE version |\n|--------------|--------------:|-------------:|\n| `Heroku-20` | `1.26.2` | PCRE1 (8.x) |\n| `Heroku-22` | `1.26.2` | PCRE1 (8.x) |\n| `Heroku-24` | `1.26.2` | PCRE2 (10.x) |\n\n## Presets\n\nWith Nginx's flexibility, it can be configured \u0026 used for many different purposes. See the documentation for the mode you wish to use.\n\n### [Static sites](static.md)\n\nHTTP server for websites and single page apps. [[docs](static.md)]\n\n### [Local proxy](proxy.md)\n\nHTTP proxy to an app server running in the same dyno, via UNIX domain sockets. [[docs](proxy.md)]\n\n_Proxy is the original buildpack mode that is enabled by default, if the `config/nginx.conf.erb` file is not added to app source._\n\n### Solo mode (deprecated)\n\nThis mode has been superceeded by [Static mode](static.md).\n\n## Custom Nginx usage\n\nHave a use for Nginx that does not fit one of the above presets?\n\nAdd this buildpack to an app, as the last buildpack:\n```bash\nheroku buildpacks:add --app APP_NAME heroku-community/nginx\n```\n\n…and then setup `config/nginx.conf.erb` \u0026 `Procfile` in the app's source repo.\n\n## General configuration\n\n### Setting the Worker Processes and Connections\n\nYou can configure Nginx's `worker_processes` directive via the\n`NGINX_WORKERS` environment variable.\n\nFor example, to set your `NGINX_WORKERS` to 8 on a PX dyno:\n\n```bash\n$ heroku config:set NGINX_WORKERS=8\n```\n\nSimilarly, the `NGINX_WORKER_CONNECTIONS` environment variable can configure the `worker_connections` directive:\n\n```bash\n$ heroku config:set NGINX_WORKER_CONNECTIONS=2048\n```\n\n### Customizable Nginx Compile Options\n\nThis requires a clone of this repository and [Docker](https://www.docker.com/). All you need to do is have Docker setup and running on your machine. The [`Makefile`](Makefile) will take care of the rest.\n\nConfiguring is as easy as changing the options passed to `./configure` in [scripts/build_nginx](scripts/build_nginx).\n\nRun the builds in a container via:\n\n```\n$ make build\n```\n\nThe binaries will be packed into `tar` files and placed in the repository's root directory. Commit the changes and push your repository.\n\nFinally update your app to use your custom buildpack on Heroku either at https://dashboard.heroku.com/apps/#{YOUR_APP_NAME}/settings or via the Heroku CLI via:\n\n```\nheroku buildpacks:set #{YOUR_GIT_REPO_CLONE}\n```\n\nTo test the builds locally:\n\n```\n$ make shell\n$ cp bin/nginx-$STACK bin/nginx\n$ FORCE=1 bin/start-nginx\n```\n\n## Upgrading dependencies\n\nProcess docs for buildpack maintainers.\n\n### Upgrading Nginx, PCRE, zlib\n\n_Please use only stable, even-numbered [Nginx releases](https://nginx.org/en/download.html)._\n\nRevise the version variables in `scripts/build_nginx`, and then run the builds in a container (requires Docker) via:\n\n```\n$ make build\n```\n\nThen, commit \u0026 pull-request the resulting changes.\n\n### Upgrading Ruby\n\n_Ruby versions are downloaded from heroku-buildpack-ruby's distribution site. Only Heroku's [supported Ruby versions](https://devcenter.heroku.com/articles/ruby-support#ruby-versions) are available._\n\nRevise the `ruby_version` variable in `bin/compile`.\n\nThen, commit \u0026 pull-request the resulting changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fheroku-buildpack-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheroku%2Fheroku-buildpack-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fheroku-buildpack-nginx/lists"}