
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Utility 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.
:heart: ERB for NGINX configuration templating.
:yellow_heart: Self-signed certificate generation via mkcert for HTTPS.
:green_heart: Tried and true NGINX for reverse proxying, and hosts mapping for DNS.
The 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.
~/.ruby-nginx/servers
. This ensures a clean separation exists between your personal NGINX configuration and Ruby NGINX's automation.[!WARNING] This gem is intended to be an aid to your development environment - complemented by Rails NGINX. Don't use this gem in production.
Install via Bundler:
bundle add ruby-nginx
Or install it manually:
gem install ruby-nginx
You can pass configuration options directly.
Ruby::Nginx.add!(
# required
domain: "example.test",
# required
port: 3000,
# default: 127.0.0.1
host: "localhost",
# default: [packaged template]
template_path: "~/projects/example-app/nginx.conf.erb",
# default: $PWD
root_path: "~/projects/example-app/public",
# default: false
ssl: true,
# default: false
log: true,
# default: ~/.ruby-nginx/certs/_[DOMAIN].pem
ssl_certificate_path: "~/projects/example-app/tmp/nginx/_example.test.pem",
# default: ~/.ruby-nginx/certs/_[DOMAIN]-key.pem
ssl_certificate_key_path: "~/projects/example-app/tmp/nginx/_example.test-key.pem",
# default: ~/.ruby-nginx/logs/[DOMAIN].access.log
access_log_path: "~/projects/example-app/log/nginx/example.test.access.log",
# default: ~/.ruby-nginx/logs/[DOMAIN].error.log
error_log_path: "~/projects/example-app/log/nginx/example.test.error.log"
)
OR you can interact with the configuration object via a block.
Ruby::Nginx.add! do |config|
config.options[:domain] = "example.test"
config.options[:port] = 3000
# etc.
end
You can pass configuration options directly.
Ruby::Nginx.remove!(domain: "example.test")
OR you can interact with the configuration object via a block. However, only domain is used during removal - all other options are ignored.
Ruby::Nginx.remove! do |config|
config.options[:domain] = "example.test"
end
To print the help text.
> ruby-nginx help
Commands:
ruby-nginx add -d, --domain=DOMAIN -p, --port=N # Add a NGINX server configuration
ruby-nginx help [COMMAND] # Describe available commands or one specific command
ruby-nginx remove -d, --domain=DOMAIN # Remove a NGINX server configuration
> ruby-nginx help add
Usage:
ruby-nginx add -d, --domain=DOMAIN -p, --port=N
Options:
-d, --domain=DOMAIN # eg. example.test
-p, --port=N # eg. 3000
-h, [--host=HOST] # default: 127.0.0.1
-r, [--root-path=ROOT_PATH] # default: $PWD
-s, [--ssl], [--no-ssl], [--skip-ssl] # default: false
-l, [--log], [--no-log], [--skip-log] # default: false
-t, [--template-path=TEMPLATE_PATH] # default: [GEM_PATH]/nginx/templates/nginx.conf
-cert-file, [--ssl-certificate-path=SSL_CERTIFICATE_PATH] # default: ~/.ruby-nginx/certs/_[DOMAIN].pem
-key-file, [--ssl-certificate-key-path=SSL_CERTIFICATE_KEY_PATH] # default: ~/.ruby-nginx/certs/_[DOMAIN]-key.pem
-access-log, [--access-log-path=ACCESS_LOG_PATH] # default: ~/.ruby-nginx/logs/[DOMAIN].access.log
-error-log, [--error-log-path=ERROR_LOG_PATH] # default: ~/.ruby-nginx/logs/[DOMAIN].error.log
Add a NGINX server configuration
> ruby-nginx help remove
Usage:
ruby-nginx remove -d, --domain=DOMAIN
Options:
-d, --domain=DOMAIN # eg. example.test
Remove a NGINX server configuration
Install development dependencies.
./bin/setup
Run the Standard Ruby linter, and RSpec test suite.
bundle exec rake
Start an interactive Ruby console (IRB).
./bin/console
Run the gem's Thor CLI directly.
./exe/ruby-nginx
OR build and install the gem to your local machine.
bundle exec rake install
ruby-nginx help
A new release will automatically be built and uploaded to RubyGems by a GitHub Actions workflow upon the push of a new Git tag.
Bug reports and pull requests are welcome on GitHub at https://github.com/bert-mccutchen/ruby-nginx.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that ruby-nginx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.