Apache to Nginx Converter
Free online Apache to nginx converter. 100% client-side.
Loading tool...
What is Apache to Nginx Converter?
The Apache to Nginx Converter translates Apache mod_rewrite configuration β the RewriteRule, RewriteCond, Redirect, and ErrorDocument directives found in .htaccess files β into equivalent nginx configuration using location blocks, return redirects, proxy_pass blocks, and error_page directives. Conversion happens entirely in your browser.
Key Benefits
- Migrate from Apache to nginx without hand-translating every rewrite rule
- Keep 301/302 redirect status codes intact to preserve SEO rankings
- Catch unsupported directives instead of silently dropping them
- Audit every conversion in a rule-by-rule table before deploying
- Keep sensitive server config private β nothing is uploaded
Common Use Cases
- β’Moving a WordPress or PHP site from Apache shared hosting to an nginx VPS
- β’Porting legacy .htaccess redirect lists into a clean nginx site config
- β’Reviewing an inherited Apache config before a platform migration
- β’Learning how nginx location and return map to familiar mod_rewrite patterns
How to Convert Apache Rewrite Rules to Nginx
- Paste your Apache config: Copy the relevant RewriteRule and Redirect lines from .htaccess into the input, or press Load sample to see a typical conversion.
- Review converted and skipped counts: The summary shows how many directives were converted and how many were skipped β skipped lines appear as TODO comments and in the warnings list.
- Compare rule by rule: The rule-by-rule table pairs each Apache line with its nginx equivalent, such as return 301 for redirects or proxy_pass for [P] proxy rules.
- Wrap, copy, and test: Tick Wrap in a server block if you need a full context, press Copy or Download to save nginx-rewrite.conf, and run nginx -t before reloading.
Key Features
- RewriteRule to location + return conversion with R=301/R/L flag handling
- [P] proxy flag becomes a proxy_pass block with standard proxy headers
- Redirect / RedirectPermanent / RedirectTemp mapped to correct status codes
- RewriteCond HTTPS-off pattern becomes an if ($scheme) HTTPS redirect
- ErrorDocument translated to nginx error_page directives
- Rule-by-rule audit table plus manual-review warnings for unsupported lines