{"id":21113239,"url":"https://github.com/tontonsb/nginx-snippets","last_synced_at":"2025-07-08T18:31:53.161Z","repository":{"id":158909787,"uuid":"234986687","full_name":"tontonsb/NGINX-snippets","owner":"tontonsb","description":"Nginx snippets and examples","archived":false,"fork":false,"pushed_at":"2024-09-07T12:58:02.000Z","size":46,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T08:11:12.430Z","etag":null,"topics":["example-project","hacktoberfest","nginx","nginx-snippets"],"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/tontonsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2020-01-20T00:04:42.000Z","updated_at":"2024-10-25T06:49:14.000Z","dependencies_parsed_at":"2024-11-05T08:42:09.147Z","dependency_job_id":null,"html_url":"https://github.com/tontonsb/NGINX-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tontonsb/NGINX-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontonsb%2FNGINX-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontonsb%2FNGINX-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontonsb%2FNGINX-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontonsb%2FNGINX-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tontonsb","download_url":"https://codeload.github.com/tontonsb/NGINX-snippets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tontonsb%2FNGINX-snippets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264323941,"owners_count":23590770,"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":["example-project","hacktoberfest","nginx","nginx-snippets"],"created_at":"2024-11-20T01:41:00.130Z","updated_at":"2025-07-08T18:31:48.172Z","avatar_url":"https://github.com/tontonsb.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# NGINX snippets\n\nSome building blocks and structure for Nginx config to change the Nginx server\nfile from this\n\n```\nserver {\n\tlisten 80;\n\tlisten [::]:80;\n\tlisten 443 ssl http2;\n\tlisten [::]:443 ssl http2;\n\n\tssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;\n\tssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;\n\tinclude /etc/letsencrypt/options-ssl-nginx.conf;\n\tssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;\n\n\taccess_log /var/log/nginx/redirected.access;\n\terror_log /var/log/nginx/redirected.error;\n\n\tserver_name\n\t\texample.com\n\t\tsub.example.com\n\t\tsub3.example.com;\n\n\treturn 301 https://www.$host$request_uri;\n}\n```\n\nto this\n\n```\nserver {\n\tinclude snippets/listen/all.conf;\n\tinclude snippets/ssl.conf;\n\tinclude snippets/log-redirect.conf;\n\n\tserver_name\n\t\texample.com\n\t\tsub.example.com\n\t\tsub3.example.com;\n\n\treturn 301 https://www.$host$request_uri;\n}\n```\n\nIt gets very easy to comprehend what's going on in the config once you get\nused to ignore `include snippets/` and just read what it says. Especially\nuseful when setting up many vhosts.\n\nThe snippets are in the snippets dir. Usage examples in sites-available dir.\n\n## Notes, conventions, tips\n\nAll junk that you don't use like `koi-win` or `uwsgi_params` can be removed.\nI usually only have this in the nginx root:\n```\n$ ls /etc/nginx\nconf.d/  modules@  modules-enabled/  nginx.conf  sites-available/  sites-enabled/  snippets/\n```\n\nNote that some of the *snippets*  like `mime.types`, `proxy_params` and the\nfastcgi conf are not there either. This config template places them within\nappropriate directories.\n\nAnything general like *ssl* or *gzip* config should go into `conf.d`. Anything\nincludable should go into snippets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftontonsb%2Fnginx-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftontonsb%2Fnginx-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftontonsb%2Fnginx-snippets/lists"}