.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.

Tool guide

  • O que são `.htaccess` e `nginx.conf` São arquivos de configuração para regras de servidor web. No Apache, .htaccess costuma controlar rewrite, bloqueios e headers por diretório. No Nginx, regras equivalentes ficam em blocos server e location.
  • O que a ferramenta faz Gera snippets para Apache e Nginx com opções comuns: liberar ou bloquear rotas específicas, habilitar CORS (origem, métodos e headers), forçar HTTPS e redirecionar para www.
  • Por que usar É útil em suporte técnico rápido, setup inicial e troubleshooting. Em vez de escrever regras do zero, você parte de um template consistente e só ajusta ao ambiente real.
  • Cuidados importantes Sempre valide em staging antes de produção. Regras de rota e rewrite variam conforme estrutura do projeto, reverse proxy, CDN e versão do servidor. Para CORS, mantenha origem e métodos estritos para reduzir superfície de ataque.

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.