nginx-reverse-proxy

Configure Nginx reverse proxy patterns for self-hosted services.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/MassimilianoPili/claude-code-config --skill nginx-reverse-proxy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nginx-reverse-proxy
Source: https://github.com/MassimilianoPili/claude-code-config/tree/main/skills/nginx-reverse-proxy
Command: npx skills add https://github.com/MassimilianoPili/claude-code-config --skill nginx-reverse-proxy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive set of Nginx configuration patterns to efficiently manage and route multiple self-hosted services behind a single domain, handling complex scenarios like WebSocket proxying, lazy DNS resolution, and OAuth2 authentication.

Core Features & Use Cases

  • Path-based Routing: Directs traffic to different services based on URL paths.
  • Lazy DNS Resolution: Prevents Nginx startup failures when backend services are temporarily unavailable.
  • WebSocket/SSE Proxying: Enables real-time communication for modern applications.
  • OAuth2 Integration: Secures services using auth_request with OAuth2 Proxy.
  • Subpath Handling: Correctly routes traffic whether the backend service expects a subpath or not.
  • Use Case: You need to expose your self-hosted Gitea, Portainer, and a custom API to the internet. This Skill's patterns will help you configure Nginx to route /git/, /portainer/, and /api/ to their respective services, all under yourdomain.com, while ensuring secure access and proper handling of real-time connections.

Quick Start

Use the nginx-reverse-proxy skill to add a new service called 'my-app' that requires WebSocket support and OAuth2 authentication.

Frequently Asked Questions about nginx-reverse-proxy

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

FAQPage Schema
How do I configure an Nginx reverse proxy for multiple self-hosted services?

Nginx reverse proxy configuration manages multiple self-hosted services by using path-based routing to direct traffic to different backend containers based on URL paths under a single domain.

Why does Nginx fail to start when a backend Docker container is unavailable?

Nginx fails to start when backend containers are unavailable because it tries to resolve DNS names at startup. You can prevent this by implementing lazy DNS resolution in your configuration.

How do I proxy WebSocket and SSE connections through Nginx?

You proxy WebSocket and SSE connections through Nginx by applying specific configuration patterns that ensure correct protocol forwarding and maintain persistent real-time communication for modern applications.

Can I secure self-hosted services behind Nginx using OAuth2?

You can secure self-hosted services behind Nginx using OAuth2 by integrating the auth_request directive, which intercepts traffic and validates authentication before routing requests to your backend containers.

What is the best way to handle subpath stripping for self-hosted applications?

Handling subpath stripping for self-hosted applications involves applying specific Nginx configuration patterns to correctly route traffic, whether the backend service expects to receive the subpath or not.

How do I get the real client IP address when using Cloudflare and Nginx?

To get the real client IP address with Cloudflare and Nginx, implement Cloudflare real IP handling configurations that correctly parse and forward the true visitor IP to your public-facing services.