{"id":13448037,"url":"https://github.com/h5bp/server-configs-nginx","last_synced_at":"2025-05-12T13:24:15.801Z","repository":{"id":9759631,"uuid":"11726680","full_name":"h5bp/server-configs-nginx","owner":"h5bp","description":"Nginx HTTP server boilerplate configs","archived":false,"fork":false,"pushed_at":"2025-05-09T23:55:59.000Z","size":464,"stargazers_count":11363,"open_issues_count":1,"forks_count":1539,"subscribers_count":385,"default_branch":"main","last_synced_at":"2025-05-10T00:29:58.723Z","etag":null,"topics":["best-practices","config","h5bp","nginx","nginx-configuration","robust","standard"],"latest_commit_sha":null,"homepage":"","language":null,"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/h5bp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["LeoColomb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2013-07-28T22:19:57.000Z","updated_at":"2025-05-10T00:14:42.000Z","dependencies_parsed_at":"2023-02-14T02:16:23.524Z","dependency_job_id":"504dce16-dc05-4557-a766-8c55969a4a3a","html_url":"https://github.com/h5bp/server-configs-nginx","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h5bp%2Fserver-configs-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h5bp%2Fserver-configs-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h5bp%2Fserver-configs-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h5bp%2Fserver-configs-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h5bp","download_url":"https://codeload.github.com/h5bp/server-configs-nginx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745717,"owners_count":21957432,"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":["best-practices","config","h5bp","nginx","nginx-configuration","robust","standard"],"created_at":"2024-07-31T05:01:33.922Z","updated_at":"2025-05-12T13:24:15.773Z","avatar_url":"https://github.com/h5bp.png","language":null,"funding_links":["https://github.com/sponsors/LeoColomb"],"categories":["miscellaneous","Others","Misc","Nginx","config","Third Modules","Tools","Configuration","best-practices","⚙️ Backend \u0026 APIs"],"sub_categories":["C Modules","Lua Modules"],"readme":"# [Nginx Server Configs](https://github.com/h5bp/server-configs-nginx)\n\n[![Server CI](https://github.com/h5bp/server-configs-nginx/actions/workflows/server.yml/badge.svg)](https://github.com/h5bp/server-configs-nginx/actions/workflows/server.yml)\n\n**Nginx Server Configs** is a collection of configuration files that can help\nyour server improve the website's performance and security, while also\nensuring that resources are served with the correct content-type and are\naccessible, if needed, even cross-domain.\n\n\n## Getting Started\n\nUsing the Nginx server configs repo directly has a few required steps to be able to work.\n\n* [Nginx Beginners Guide](https://nginx.org/en/docs/beginners_guide.html)\n* [Nginx Request Processing](https://nginx.org/en/docs/http/request_processing.html)\n\n\n### Check `nginx.conf` settings\n\nThe first thing to check is that the `nginx.conf` file contains appropriate values for\nyour specific install.\n\nMost specific variables are:\n\n* `user`\n* `error_log`\n* `pid`\n* `access_log`\n\n### Nginx test and restart\n\n* To verify Nginx config\n\n  ```shell\n  nginx -t\n  ```\n\n* To verify Nginx config with a custom file\n\n  ```shell\n  nginx -t -c nginx.conf\n  ```\n\n* To reload Nginx and apply the new config\n\n  ```shell\n  nginx -s reload\n  ```\n\n### Repository structure\n\nThis repository has the following structure:\n\n```text\n./\n├── conf.d/\n│   ├── default.conf\n│   └── templates/\n├── h5bp/\n│   ├── basic.conf\n│   ├── location/\n│   └── .../\n├── custom.d/\n│   └── .../\n├── mime.types\n└── nginx.conf\n```\n\n* **`conf.d/`**\n\n  This directory should contain all the `server` definitions.\n\n  Except if they are dot prefixed or non `.conf` extension, all files in this\n  directory are loaded automatically.\n\n  * **`templates` folder**\n\n    Files in this directory contain a `server` template for secure and non-secure\n    hosts. They are intended to be copied in the `conf.d` directory with all\n    `example.com` occurrences changed to the target host.\n\n* **`h5bp/`**\n\n  This directory contains config snippets (mixins) to be included as desired.\n\n  There are two types of config files provided: individual config snippets and\n  combined config files which provide convenient defaults.\n\n  * **`basic.conf`**\n\n    This file loads a small subset of the rules provided by this repository to add\n    `expires` headers, allow cross-domain fonts and protect system files from web\n    access.\n    The `basic.conf` file includes the rules which are recommended to always be\n    defined.\n\n  * **`location/`**\n  \n    Files in this directory contain one or more `location` directives. They are\n    intended to be loaded in the `server` context (or, in a nested `location` block).\n\n* **`custom.d/`**\n\n  This directory should contain all the custom `nginx.conf` configuration.\n\n  Except if they are dot prefixed or non `.conf` extension, all files in this\n  folder are loaded automatically.\n\n* **`mime.types`**\n\n  The `mime.types` file is responsible for mapping file extensions to MIME types.\n\n* **`nginx.conf`**\n\n  The main Nginx config file.\n\n\n## Usage\n\n### As a reference\n\nTo use as reference requires no special installation steps, download/checkout the\nrepository to a convenient location and adapt your existing Nginx configuration\nincorporating the desired functionality from this repository.\n\nDownload the [latest release archive](https://github.com/h5bp/server-configs-nginx/releases/latest).\n\n### Directly\n\nTo use directly, replace the Nginx config directory with this repository.\nFor example:\n\n```shell\nnginx -s stop\ncd /etc\nmv nginx nginx-previous\ngit clone https://github.com/h5bp/server-configs-nginx.git nginx\n# install-specific edits\nnginx\n```\n\n### Manage sites\n\n```bash\ncd /etc/nginx/conf.d\n```\n\n* Creating a new site\n\n  ```bash\n  cp templates/example.com.conf .actual-hostname.conf\n  sed -i 's/example.com/actual-hostname/g' .actual-hostname.conf\n  ```\n\n* Enabling a site\n\n  ```bash\n  mv .actual-hostname.conf actual-hostname.conf\n  ```\n\n* Disabling a site\n\n  ```bash\n  mv actual-hostname.conf .actual-hostname.conf\n  ```\n\n```bash\nnginx -s reload\n```\n\n\n## Support\n\n * Nginx v**1.8.0**+\n\n\n## Contributing\n\nAnyone is welcome to [contribute](.github/CONTRIBUTING.md),\nhowever, if you decide to get involved, please take a moment to review\nthe [guidelines](.github/CONTRIBUTING.md):\n\n* [Bug reports](.github/CONTRIBUTING.md#bugs)\n* [Feature requests](.github/CONTRIBUTING.md#features)\n* [Pull requests](.github/CONTRIBUTING.md#pull-requests)\n\n\n## Acknowledgements\n\n[Nginx Server Configs](https://github.com/h5bp/server-configs-nginx) is\nonly possible thanks to all the awesome\n[contributors](https://github.com/h5bp/server-configs-nginx/graphs/contributors)!\n\n\n## License\n\nThe code is available under the [MIT license](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh5bp%2Fserver-configs-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh5bp%2Fserver-configs-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh5bp%2Fserver-configs-nginx/lists"}