nginx-default-conf

Generates nginx.default.conf for nginx conf.d directory configuration. Serves static files from /usr/share/nginx/html.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025⬇️1downloads

When & Why to Use This Skill

This Claude skill automates the generation of production-ready Nginx configuration files, specifically optimized for serving Single Page Applications (SPAs) and static content. It streamlines the setup of essential web server features including SPA routing, aggressive caching, CORS headers, and custom error handling, making it an essential tool for DevOps and frontend deployment workflows.

Use Cases

  • Deploying Modern Frontend Frameworks: Automatically configure Nginx to handle client-side routing for React, Vue, or Angular apps using the try_files directive to prevent 404 errors on refresh.
  • Docker Containerization: Generate standardized nginx.default.conf files for use in Dockerfiles to ensure consistent and reliable web server behavior across different environments.
  • Web Performance Optimization: Implement 'expires max' headers and efficient static file serving from /usr/share/nginx/html to improve site speed and Core Web Vitals.
  • Security and Integration: Quickly enable CORS with wildcard origins and set up custom 50x error pages to improve the resilience and interoperability of web services.
namenginx-default-conf
descriptionGenerates nginx.default.conf for nginx conf.d directory configuration. Serves static files from /usr/share/nginx/html.

Nginx Default Conf Skill

Purpose

Generate nginx.default.conf file for nginx conf.d directory configuration.

Output

Create the file: nginx.default.conf

Template

See: examples.md in this directory for complete template and detailed examples.

Notes

  • Nginx configuration for conf.d directory
  • Serves static files from /usr/share/nginx/html
  • Configured for SPA routing with try_files fallback to index.html
  • Enables aggressive caching with expires max
  • CORS enabled with wildcard origin for development
  • Custom error pages for 500-series errors
  • Used in Dockerfile: copied to /etc/nginx/conf.d/default.conf