{"id":16851022,"url":"https://github.com/parkr/nginxconf","last_synced_at":"2026-02-12T04:03:37.237Z","repository":{"id":55007639,"uuid":"106201561","full_name":"parkr/nginxconf","owner":"parkr","description":"Generate nginx configurations for three common site types: static, proxy, and redirect.","archived":false,"fork":false,"pushed_at":"2024-11-25T18:17:05.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T12:39:14.624Z","etag":null,"topics":["nginx","nginx-configuration","nginx-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","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/parkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-10-08T18:57:47.000Z","updated_at":"2024-11-25T18:17:03.000Z","dependencies_parsed_at":"2025-01-24T15:44:20.966Z","dependency_job_id":"fbb86eb8-19aa-49f4-b8fe-5279c9421471","html_url":"https://github.com/parkr/nginxconf","commit_stats":{"total_commits":31,"total_committers":4,"mean_commits":7.75,"dds":"0.16129032258064513","last_synced_commit":"92df9225d9b17c66d91ff65434cb953e3ca6e650"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/parkr/nginxconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkr%2Fnginxconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkr%2Fnginxconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkr%2Fnginxconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkr%2Fnginxconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parkr","download_url":"https://codeload.github.com/parkr/nginxconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkr%2Fnginxconf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270951282,"owners_count":24674007,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["nginx","nginx-configuration","nginx-proxy"],"created_at":"2024-10-13T13:26:26.194Z","updated_at":"2026-02-12T04:03:37.182Z","avatar_url":"https://github.com/parkr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginxconf\n\nA set of utilities for generating nginx configurations.\n\nTo install, simply run:\n\n```console\n$ go get github.com/parkr/nginxconf/...\n```\n\n## nginx-conf-gen\n\nThis command generates nginx `server` blocks. It can be used to generate\none of three different types of sites:\n\n1. Static site (serve files from a directory)\n2. Proxy site (act as a reverse proxy to another server running on the same host)\n3. Redirect site (redirect any incoming traffic to another domain)\n\nBy default, it generates strong a strong SSL configuration based on Let's\nEncrypt conventions. It does not generate certificates for you, however.\n\nThese all print to stdout. You can redirect the contents to a file in your\nnginx installation's `sites-available` directory.\n\n### 1. Static site\n\nTo generate a static site, you'll need a directory with your static site to\nserve from. Then, simply run:\n\n```console\n$ nginx-conf-gen -domain=\"example.org\" \\\n    -static -webroot=/var/www/html\n```\n\nThis will serve the contents of `/var/www/html` at `https://example.org`.\n\n### 2. Proxy site\n\nTo generate a proxy site, you'll need to know what port to forward the\ntraffic to.\n\n```console\n$ nginx-conf-gen -domain=\"example.org\" \\\n    -proxy -port=8080\n```\n\nThis will serve all traffic from your server running at `localhost:8080` at `https://example.org`.\n\n### 3. Redirect site\n\nTo generate a proxy site, you'll need a schema and host to redirect traffic\nto, e.g. `https://example.co`.\n\n```console\n$ nginx-conf-gen -domain=\"example.org\" \\\n    -redirect=\"https://example.co\"\n```\n\nThis will redirect all traffic to `example.org` to `https://example.co`.\n\n## nginx-mimes-gen\n\nThis command pulls down the MIME types from [mime-db](https://github.com/jshttp/mime-db)\nand generates an nginx `types` block. It is quite an extensive list but is\nuseful for serving static sites properly.\n\nTo run this command, you will need to know where your nginx configuration\nlives. On my servers, it usually lives in `/opt/nginx/conf`. There's a file\ncalled `mime.types` which I just overwrite:\n\n```console\n$ nginx-mimes-gen \u003e /opt/nginx/conf/mime.types\n```\n\nIn the main `http` block in your `nginx.conf` file, ensure the line\n`include mime.types;` exists. If it's not there, add it and reload nginx.\nVoilà!\n\n## LICENSE\n\nCode released under The MIT License. See LICENSE.md for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkr%2Fnginxconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparkr%2Fnginxconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkr%2Fnginxconf/lists"}