{"id":25698069,"url":"https://github.com/bert-mccutchen/ruby-nginx","last_synced_at":"2026-03-15T15:50:32.068Z","repository":{"id":264091752,"uuid":"892329762","full_name":"bert-mccutchen/ruby-nginx","owner":"bert-mccutchen","description":"Utility for configuring reverse proxies with DNS, NGINX, SSL, and logging.","archived":false,"fork":false,"pushed_at":"2025-12-24T19:02:11.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T09:40:19.472Z","etag":null,"topics":["automation","certificates","cli","development-tools","logging","mkcert","nginx-configuration","nginx-proxy","ruby-gem","ssl"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/bert-mccutchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"bertm","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-11-21T23:01:52.000Z","updated_at":"2025-12-24T19:02:15.000Z","dependencies_parsed_at":"2025-01-30T14:27:39.372Z","dependency_job_id":"0293b621-5531-4b6d-8995-53d6b8f935d5","html_url":"https://github.com/bert-mccutchen/ruby-nginx","commit_stats":null,"previous_names":["bert-mccutchen/ruby-nginx"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bert-mccutchen/ruby-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bert-mccutchen%2Fruby-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bert-mccutchen%2Fruby-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bert-mccutchen%2Fruby-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bert-mccutchen%2Fruby-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bert-mccutchen","download_url":"https://codeload.github.com/bert-mccutchen/ruby-nginx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bert-mccutchen%2Fruby-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30545771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T15:03:43.933Z","status":"ssl_error","status_checked_at":"2026-03-15T15:03:37.630Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automation","certificates","cli","development-tools","logging","mkcert","nginx-configuration","nginx-proxy","ruby-gem","ssl"],"created_at":"2025-02-25T02:38:07.369Z","updated_at":"2026-03-15T15:50:32.041Z","avatar_url":"https://github.com/bert-mccutchen.png","language":"Ruby","funding_links":["https://ko-fi.com/bertm","https://ko-fi.com/M4M76DVZR"],"categories":[],"sub_categories":[],"readme":"# Ruby NGINX\n\nUtility gem with an added CLI for setting up reverse proxies with custom domains. Because sometimes you just don't want to use containers, or your platform doesn't natively run containers without a virtual machine - I'm looking at you - Darwin.\n\n:heart: ERB for NGINX configuration templating.\n\n:yellow_heart: Self-signed certificate generation via mkcert for HTTPS.\n\n:green_heart: Tried and true NGINX for reverse proxying, and hosts mapping for DNS.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/M4M76DVZR)\n\n---\n\n### Key Features\n\nThe aim of this gem is to be easy to use, while keeping the user in control of their own machine. With Ruby NGINX's automation, you should feel comfortable, informed, and in control of the process.\n\n- Automated installation of NGINX and mkcert that are entirely optional.\n  - You will be prompted before installation. You may reject installation to install NGINX or mkcert on your own terms.\n- Sudo - only when necessary, and on your own terms.\n  - By default, all attempts to configure or interact with NGINX, /etc/hosts, and mkcert, are done without elevated privileges. Sudo is only used when the initial attempt fails with your users privileges.\n  - You will be prompted to accept sudo elevation, and why it is required. Rejection will immediately abort the process.\n- Isolated NGINX configuration.\n  - Your NGINX configuration will automatically be updated to include configuration files from `~/.ruby-nginx/servers`. This ensures a clean separation exists between your personal NGINX configuration and Ruby NGINX's automation.\n- Cross-platform and support for multiple package managers.\n  - macOS - brew\n  - Linux - apt-get, pacman, yum, zypper\n- Complete configuration - everything is configurable. You can even bring your own NGINX config, and if you'd like, your own :beers:.\n\n\u003e [!WARNING]\n\u003eThis gem is intended to be an aid to your development environment - complemented by [Rails NGINX](https://github.com/bert-mccutchen/rails-nginx). **Don't use this gem in production.**\n\n---\n\n### Contents\n\n- [Installation](#installation)\n- [Library Usage](#library-usage)\n  - [Adding an NGINX configuration](#adding-an-nginx-configuration)\n  - [Removing an NGINX configuration](#removing-an-nginx-configuration)\n- [CLI Usage](#cli-usage)\n  - [Help](#help)\n  - [Adding an NGINX configuration](#adding-an-nginx-configuration-1)\n  - [Removing an NGINX configuration](#removing-an-nginx-configuration-1)\n- [Development](#development)\n  - [Setup](#setup)\n  - [Lint / Test](#lint--test)\n  - [Debug Console](#debug-console)\n  - [CLI Executable](#cli-executable)\n  - [Release](#release)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\nInstall via Bundler:\n```bash\nbundle add ruby-nginx\n```\n\nOr install it manually:\n```bash\ngem install ruby-nginx\n```\n\n## Library Usage\n\n### Adding an NGINX configuration\n\nYou can pass configuration options directly.\n```ruby\nRuby::Nginx.add!(\n  # required\n  domain: \"example.test\",\n\n  # required\n  port: 3000,\n\n  # default: 127.0.0.1\n  host: \"localhost\",\n\n  # default: [packaged template]\n  template_path: \"~/projects/example-app/nginx.conf.erb\",\n\n  # default: $PWD\n  root_path: \"~/projects/example-app/public\",\n\n  # default: false\n  ssl: true,\n\n  # default: false\n  log: true,\n\n  # default: ~/.ruby-nginx/certs/_[DOMAIN].pem\n  ssl_certificate_path: \"~/projects/example-app/tmp/nginx/_example.test.pem\",\n\n  # default: ~/.ruby-nginx/certs/_[DOMAIN]-key.pem\n  ssl_certificate_key_path: \"~/projects/example-app/tmp/nginx/_example.test-key.pem\",\n\n  # default: ~/.ruby-nginx/logs/[DOMAIN].access.log\n  access_log_path: \"~/projects/example-app/log/nginx/example.test.access.log\",\n\n  # default: ~/.ruby-nginx/logs/[DOMAIN].error.log\n  error_log_path: \"~/projects/example-app/log/nginx/example.test.error.log\"\n)\n```\n\nOR you can interact with the configuration object via a block.\n```ruby\nRuby::Nginx.add! do |config|\n  config.options[:domain] = \"example.test\"\n  config.options[:port] = 3000\n  # etc.\nend\n```\n\n### Removing an NGINX configuration\n\nYou can pass configuration options directly.\n```ruby\nRuby::Nginx.remove!(domain: \"example.test\")\n```\n\nOR you can interact with the configuration object via a block. However, only domain is used during removal - all other options are ignored.\n```ruby\nRuby::Nginx.remove! do |config|\n  config.options[:domain] = \"example.test\"\nend\n```\n\n## CLI Usage\n\n### Help\n\nTo print the help text.\n```\n\u003e ruby-nginx help\nCommands:\n  ruby-nginx add -d, --domain=DOMAIN -p, --port=N  # Add a NGINX server configuration\n  ruby-nginx help [COMMAND]                        # Describe available commands or one specific command\n  ruby-nginx remove -d, --domain=DOMAIN            # Remove a NGINX server configuration\n```\n\n### Adding an NGINX configuration\n\n```\n\u003e ruby-nginx help add\nUsage:\n  ruby-nginx add -d, --domain=DOMAIN -p, --port=N\n\nOptions:\n  -d,          --domain=DOMAIN                                        # eg. example.test\n  -p,          --port=N                                               # eg. 3000\n  -h,          [--host=HOST]                                          # default: 127.0.0.1\n  -r,          [--root-path=ROOT_PATH]                                # default: $PWD\n  -s,          [--ssl], [--no-ssl], [--skip-ssl]                      # default: false\n  -l,          [--log], [--no-log], [--skip-log]                      # default: false\n  -t,          [--template-path=TEMPLATE_PATH]                        # default: [GEM_PATH]/nginx/templates/nginx.conf\n  -cert-file,  [--ssl-certificate-path=SSL_CERTIFICATE_PATH]          # default: ~/.ruby-nginx/certs/_[DOMAIN].pem\n  -key-file,   [--ssl-certificate-key-path=SSL_CERTIFICATE_KEY_PATH]  # default: ~/.ruby-nginx/certs/_[DOMAIN]-key.pem\n  -access-log, [--access-log-path=ACCESS_LOG_PATH]                    # default: ~/.ruby-nginx/logs/[DOMAIN].access.log\n  -error-log,  [--error-log-path=ERROR_LOG_PATH]                      # default: ~/.ruby-nginx/logs/[DOMAIN].error.log\n\nAdd a NGINX server configuration\n```\n\n### Removing an NGINX configuration\n\n```\n\u003e ruby-nginx help remove\nUsage:\n  ruby-nginx remove -d, --domain=DOMAIN\n\nOptions:\n  -d, --domain=DOMAIN  # eg. example.test\n\nRemove a NGINX server configuration\n```\n\n## Development\n\n### Setup\n\nInstall development dependencies.\n```\n./bin/setup\n```\n\n### Lint / Test\n\nRun the Standard Ruby linter, and RSpec test suite.\n```\nbundle exec rake\n```\n\n### Debug Console\n\nStart an interactive Ruby console (IRB).\n```\n./bin/console\n```\n\n### CLI Executable\n\nRun the gem's Thor CLI directly.\n```\n./exe/ruby-nginx\n```\n\nOR build and install the gem to your local machine.\n```\nbundle exec rake install\nruby-nginx help\n```\n\n### Release\n\nA new release will automatically be built and uploaded to RubyGems by a [GitHub Actions workflow](./.github/workflows/gem-push.yml) upon the push of a new Git tag.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/bert-mccutchen/ruby-nginx.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbert-mccutchen%2Fruby-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbert-mccutchen%2Fruby-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbert-mccutchen%2Fruby-nginx/lists"}