Deploy nginx-modsecurity-waf

Deploy and Host nginx-modsecurity-waf with Railway

Deploy nginx-modsecurity-waf

coreruleset/modsecurity-crs

coreruleset/modsecurity-crs:nginx-alpine

Just deployed

Deploy and Host nginx-modsecurity-waf on Railway

nginx-modsecurity-waf is a lightweight security reverse proxy built with Nginx, ModSecurity 3, and the OWASP Core Rule Set. It filters and blocks common web attacks before they reach your backend.

About Hosting nginx-modsecurity-waf

Deploying nginx-modsecurity-waf means running an Nginx reverse proxy with ModSecurity enabled and CRS rules loaded. The WAF inspects every request and only forwards clean traffic to your backend. On Railway it listens on port 8080 and connects to your app using the BACKEND environment variable. Railway handles networking, scaling, and SSL termination so you get a fully managed WAF with minimal setup.

Common Use Cases

  • Protecting APIs and web apps from common attacks
  • Securing legacy apps without modifying the code
  • Adding a filtering layer in front of microservices

Dependencies for nginx-modsecurity-waf Hosting

  • A reachable backend service
  • DNS resolvers for outbound traffic

Deployment Dependencies

Implementation Details

Example environment variables:

PORT=8080
BACKEND=http://backend:8080
BLOCKING_PARANOIA=1
DETECTION_PARANOIA=1
MODSEC_AUDIT_ENGINE=RelevantOnly
MODSEC_AUDIT_LOG=/dev/stdout
ALLOWED_METHODS=GET HEAD POST OPTIONS
ALLOWED_REQUEST_CONTENT_TYPE="|application/json|"
RESOLVERS="8.8.8.8 1.1.1.1"
SSL_ENGINE=off
NGINX_ALWAYS_TLS_REDIRECT=off

Health check path: /healthz

Why Deploy nginx-modsecurity-waf on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you do not have to deal with configuration while allowing you to vertically and horizontally scale it.

By deploying nginx-modsecurity-waf on Railway, you are one step closer to supporting a complete full stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh