Nginx Config Generator
Generate Nginx server configuration files visually. SSL, reverse proxy, gzip, caching, security headers, WebSocket, rate limiting, CORS, and PHP support.
SSL & HTTP
Backend
Optimization & Security
Generated Configuration
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
root /var/www/html;
index index.html index.htm;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location ~* \.(jpg|jpeg|png|gif|ico|svg|webp|woff2|woff|ttf|css|js)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ =404;
}
location ~ /\.ht {
deny all;
}
}Save as /etc/nginx/sites-available/example.com and symlink to sites-enabled/
Frequently Asked Questions
Related Tools
JSON Formatter
Format, validate, and minify JSON data with syntax highlighting.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text.
Regex Tester
Test and debug regular expressions in real-time. Matches highlighted, capture groups, replacements.
CSV to JSON Converter
Convert CSV data to JSON arrays and JSON arrays back to CSV. Custom delimiters supported.
Text Diff Checker
Compare two texts and see additions, removals, and unchanged lines highlighted side by side.
Image to Base64 Converter
Convert images to Base64 encoded strings and data URIs. Supports PNG, JPEG, GIF, WebP, and SVG. No upload, fully private.