可视化构建 nginx.conf,设置 Server 块、Location、代理、SSL 和缓存,提供模板和验证功能。
Build nginx.conf visually. Configure server blocks, location rules, SSL, gzip, and caching. Start from templates or build from scratch.
server {
listen 80;
server_name example.com;
root /var/www/html;
access_log /var/log/nginx/access.log;
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml;
gzip_min_length 1000;
location / {
try_files $uri $uri/ =404;
}
location /assets/ {
autoindex off;
expires 365d;
add_header Cache-Control "public, immutable";
}
}使用 The IT Hustle 免费 Nginx 配置生成器,为静态站点、反向代理和单页应用构建 nginx server 块。