Nginx 설정 생성기
Nginx 서버 설정 파일 생성
기본 설정
기능 설정
Nginx Configuration Guide
Configuration File Location
# Main config: /etc/nginx/nginx.conf
# Site configs: /etc/nginx/sites-available/
# Enabled sites: /etc/nginx/sites-enabled/
Common Commands
# Test configuration
sudo nginx -t
# Reload configuration
sudo systemctl reload nginx
# Restart Nginx
sudo systemctl restart nginx
# Enable site
sudo ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
SSL with Let's Encrypt
# Install Certbot
sudo apt install certbot python3-certbot-nginx
# Obtain certificate
sudo certbot --nginx -d example.com -d www.example.com
# Auto-renewal
sudo certbot renew --dry-run
Best Practices
- Always test configuration before reloading:
nginx -t - Use HTTPS with HTTP/2 for better performance
- Enable gzip compression for text-based content
- Set appropriate cache headers for static files
- Configure security headers (X-Frame-Options, CSP, etc.)
- Use separate log files for each virtual host
Related Tools
관련 도구
Linux & System 전체 보기함께 쓰면 좋은 도구를 확인하세요.