Nginx Config Generator
Online Nginx configuration generator supporting reverse proxy, load balancing, SSL/TLS and other common scenarios
Basic Configuration
Reverse Proxy
SSL/TLS
Load Balancing
Generated Configuration
server {
listen 80;
listen [::]:80;
server_name example.com;
# 网站根目录
root /var/www/html;
index index.html index.htm index.php;
# 主要位置配置
location / {
try_files $uri $uri/ =404;
}
# 静态文件缓存
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff|woff2|ttf|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# 安全头
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-XSS-Protection "1; mode=block" always;
}Configuration Templates
Documentation
Introduction
Nginx Config Generator helps you quickly generate Nginx server configuration files with support for reverse proxy, load balancing, SSL/TLS, and other common scenarios.
Features
Basic Configuration
Configure server name, listen port, and root directory for static website deployment.
server_name example.com;
Reverse Proxy
Forward requests to backend services, suitable for API gateways or microservices architecture.
proxy_pass http://localhost:3000;
SSL/TLS
Enable HTTPS encrypted communication with certificate and key paths, includes HTTP to HTTPS redirect.
listen 443 ssl;
Load Balancing
Distribute requests across multiple backend servers with round robin, least connections, or IP hash strategies.
upstream backend { server 192.168.1.10; }
Use Cases
Static Website Deployment
Select the static website template, configure domain and root directory, generate base Nginx configuration.
API Gateway Configuration
Enable reverse proxy to forward external requests to internal API services with multi-backend load balancing.
HTTPS Website Deployment
Enable SSL with certificate paths to automatically generate HTTP to HTTPS redirect configuration.
WordPress Deployment
Select the WordPress template to generate professional configuration with PHP handling and rewrite rules.