{"id":16347683,"url":"https://github.com/oscarotero/nginx-snippets","last_synced_at":"2025-03-23T00:32:54.352Z","repository":{"id":66292618,"uuid":"143910674","full_name":"oscarotero/nginx-snippets","owner":"oscarotero","description":"Custom snippets for nginx","archived":false,"fork":false,"pushed_at":"2019-02-11T13:06:48.000Z","size":13,"stargazers_count":14,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T16:04:07.670Z","etag":null,"topics":["nginx","nginx-configuration"],"latest_commit_sha":null,"homepage":null,"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/oscarotero.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-07T18:14:35.000Z","updated_at":"2025-02-16T04:31:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"deb333f2-599d-49ec-af8c-5791e9692183","html_url":"https://github.com/oscarotero/nginx-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fnginx-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fnginx-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fnginx-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarotero%2Fnginx-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarotero","download_url":"https://codeload.github.com/oscarotero/nginx-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040235,"owners_count":20551297,"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":["nginx","nginx-configuration"],"created_at":"2024-10-11T00:44:48.189Z","updated_at":"2025-03-23T00:32:54.333Z","avatar_url":"https://github.com/oscarotero.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx-snippets\n\nCustom snippets for nginx with http2\n\n## Install\n\n```\ncd /etc/nginx/snippets\ngit clone https://github.com/oscarotero/nginx-snippets.git\n```\n\n## Snippets\n\nThis package contains a set of config files with best practices that you can include in your nginx config.\n\n- `http.conf`: Common http settings to include inside the `http` block.\n- `server.conf`: Common http settings to include inside each `server` block.\n- `html.conf`: Settings, headers and security stuff to use with html responses.\n- `media.conf`:  Settings, headers and security stuff to use with media responses (images, videos, audio, fonts, etc).\n- `assets.conf`:  Settings, headers and security stuff to use with text-based assets like css and javascript.\n\n## Usage\n\n```conf\nhttp {\n  include snippets/nginx-snippets/http.conf;\n  \n  server {\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    include snippets/nginx-snippets/server.conf;\n\n    location / {\n      include snippets/nginx-snippets/html.conf;\n    }\n\n    # Media and fonts\n    location ~* \\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc|ttf|ttc|otf|eot|woff|woff2)$ {\n      include snippets/nginx-snippets/media.conf;\n    }\n\n    # Assets: css, javascript, etc\n    location ~* \\.(?:css|js|webmanifest)$ {\n      include snippets/nginx-snippets/assets.conf;\n    }\n  }\n}\n```\n\n## Other tools\n\n- Configure CSP: [CSP is Awesome](https://www.cspisawesome.com/):\n- Configure SSL: [Mozilla SSL Configuration Generator](https://mozilla.github.io/server-side-tls/ssl-config-generator/)\n- NGINX Config Generator: [nginxconfig.io](https://nginxconfig.io/)\n- NGINX Quick Reference: [trimstray/nginx-quick-reference](https://github.com/trimstray/nginx-quick-reference)\n\n## Testing\n\n- [Observatory by Mozilla](https://observatory.mozilla.org/)\n- [Webhint](https://webhint.io/scanner/)\n- [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Fnginx-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarotero%2Fnginx-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarotero%2Fnginx-snippets/lists"}