.htaccess and Nginx Config Generator

Generate Apache and Nginx snippets for allow/block routes, CORS, HTTPS, and www redirects.

Permite respostas com headers CORS (origem, metodos e headers) para chamadas de outro dominio. Permite respuestas con headers CORS (origen, metodos y headers) para llamadas desde otro dominio. Adds CORS response headers (origin, methods, and headers) for cross-domain requests.

Quando ativo, localhost e faixas privadas (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x e ::1) passam mesmo com bloqueios de rota. Cuando esta activo, localhost y rangos privados (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x y ::1) pasan incluso con bloqueos de ruta. When enabled, localhost and private ranges (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, and ::1) are allowed even with route blocking.

Redireciona HTTP para HTTPS (301). Redirige HTTP a HTTPS (301). Redirects HTTP to HTTPS (301).

Redireciona domínio sem www para versao com www. Redirige dominio sin www a version con www. Redirects non-www host to www.

Overview

Practical tool for incidents and initial setup. Generate a starting point and adjust to your real environment before production.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Common case — Bloquear /admin antigo, liberar /api e habilitar CORS para frontend.

Tool guide

  • What .htaccess and nginx.conf are Server configuration files for web rules. In Apache, .htaccess often handles rewrites, access control, and headers. In Nginx, equivalent logic is configured in server and location blocks.

  • What the tool does Generates Apache and Nginx snippets for common needs: allow/block specific routes, configure CORS (origin, methods, headers), force HTTPS, and optionally redirect to www.

  • Why use it Useful for fast troubleshooting and initial setup. Instead of writing everything from scratch, you start from a consistent baseline and adjust to your environment.

  • Important precautions Validate in staging before production. Rewrite and route rules vary by app structure, reverse proxy, CDN, and server version. Keep CORS as strict as possible.

Code Snippets

Code example
Bloquear /admin antigo, liberar /api e habilitar CORS para frontend.

Common case

Bloquear /admin antigo, liberar /api e habilitar CORS para frontend.

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.