nginx-default-conf

Generate nginx.default.conf with SPA routing, CORS, caching, and error handling.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill nginx-default-conf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nginx-default-conf
Source: https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template/tree/main/.github/agents/app-starter/agents-context/skills/nginx-default-conf
Command: npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill nginx-default-conf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill generates nginx.default.conf in the project root to configure an nginx conf.d directory for serving static assets, with SPA routing support and sensible defaults for production.

Core Features & Use Cases

  • Generates nginx.default.conf in the project root for serving static content from /usr/share/nginx/html.
  • Implements SPA routing via try_files to support client-side navigation in Vue/Vite apps.
  • Enables CORS headers for cross-origin access in micro-frontend and CDN scenarios.
  • Applies caching headers and proper error handling with a 50x page for better UX.
  • Integrates with Docker by aligning with the common copy step to /etc/nginx/conf.d/default.conf.

Quick Start

Generate nginx.default.conf in the project root with the provided production defaults.

Frequently Asked Questions about nginx-default-conf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure nginx for SPA routing with Vue or Vite?

To configure nginx for SPA routing, you need a default.conf file using try_files to redirect client-side navigation paths to index.html. This Skill auto-generates that configuration in your project root with production-ready defaults for Vue or Vite apps.

How do I set up nginx static hosting with Docker?

Setting up nginx static hosting with Docker involves mapping your configuration to /etc/nginx/conf.d/default.conf. This Skill generates the configuration file aligned with that Docker copy step, listening on port 8080 with /usr/share/nginx/html as the root directory.

Why does my nginx configuration break when I refresh a Vue SPA route?

Your nginx configuration likely breaks on refresh because it lacks try_files directives for SPA routing. This Skill generates a configuration that implements try_files to properly route client-side navigation paths back to index.html.

Can I add CORS headers to nginx for a micro-frontend setup?

Yes, you can add CORS headers to nginx for micro-frontend access by including Access-Control-Allow-Origin directives in your configuration. This Skill automatically incorporates CORS headers suitable for cross-origin scenarios.

Does this nginx configuration include custom error handling for 50x pages?

Yes, the nginx configuration includes custom error handling routing 50x errors to a dedicated error page for better user experience. This Skill generates the default.conf with this 50x error page routing built into the production-ready defaults.