理悟万池
全部工具

运维工具 · NGINX

Nginx 配置生成器

表单式快速生成 Nginx 配置:反向代理 / SSL / Gzip / 缓存 / 速率限制 / WebSocket,支持多路由。

基础配置
SSL / HTTPS
功能选项
路由 (location)
生成的 nginx.conf
server {
    listen 80;
    listen [::]:80;
    server_name example.com;

    # Gzip 压缩
    gzip on;
    gzip_vary on;
    gzip_min_length 1024;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # 安全头
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-XSS-Protection "1; mode=block" always;
}

功能特性

  • 生成 Nginx 反向代理与多个 location 路由配置
  • 支持 HTTPS、WebSocket、Gzip、静态缓存和访问限流选项
  • 实时预览 nginx.conf,可复制后用 nginx -t 校验

使用说明

填写域名和上游服务地址,按需启用 HTTPS、缓存、WebSocket 或限流。复制配置到 Nginx 的 conf.d 目录后,先运行 nginx -t,确认无误再重新加载服务。

所有数据在浏览器本地处理,不会上传到任何服务器。关闭页面即清零,无追踪、无登录。