← 返回工具箱

htaccess 转 nginx Apache .htaccess → Nginx config

转换 示例 清空
包裹 server location / 不包裹
缩进 2 4
保留注释 行级溯源
复制结果 下载 .conf
输入(.htaccess)
{{ inputStats }}
输出(nginx.conf)
{{ outputStats }}
L{{ r.line }} {{ r.tag }} {{ r.msg }}
{{ status }}
转换 {{ stats.converted }} 条 · 跳过 {{ stats.skipped }} 条 · 警告 {{ stats.warned }} 条 Ctrl/⌘ + Enter 转换

htaccess 转 nginx

Apache .htaccess 转 nginx 配置:纯前端转换器。RewriteCond / RewriteRule(R/F/G/L/NC/QSA flag 全支持),20+ Apache 变量自动映射为 $host/$https/$http_user_agent;多条 cond 用 set+if 模拟规避 nginx 不能嵌套;Redirect→location return、ErrorDocument→error_page、Options→autoindex、Header→add_header、AuthName→auth_basic、ExpiresDefault→expires;<FilesMatch>→location ~、<Limit>→limit_except、<IfModule> 扁平化。包裹 server / location / 无三选一,2/4 缩进、保留注释、行级溯源 # L12。报告分 OK/INFO/WARN/SKIP 四级。CodeMirror 双栏 + Ctrl/⌘+Enter + 下载 nginx.conf

本工具由 在线小工具大全 提供,更多 同类工具 可在站内查看。