Skip to main content

Overview

Nginx is a high-performance web server and reverse proxy. This template deploys Nginx as a reverse proxy that routes incoming traffic to workloads in your GVC based on configurable path-based location rules.

What Gets Created

  • Workload — A serverless Nginx reverse proxy with configurable routing rules and autoscaling.
  • Secret — An opaque secret containing the rendered Nginx configuration file, mounted into the container at startup.
  • Identity & Policy — An identity bound to the workload with reveal access to the configuration secret.
  • Example Backend Workload (optional) — A sample backend workload used to verify the proxy is working. Enabled when enableExample: true. Disable this before using in production.
This template does not create a GVC. You must deploy it into an existing GVC.

Installation

This template has no external prerequisites. To install, follow the instructions for your preferred method:

Configuration

The default values.yaml for this template:
proxyWorkload:
  image: nginx:latest
  port: 80
  capacityAI: false
  timeoutSeconds: 5

resources:
  cpu: 100m
  memory: 128Mi

autoscaling:
  minScale: 1
  maxScale: 1
  maxConcurrency: 1000

enableExample: true # set to false when routing to your own workloads

locations: [] # add your own proxy targets here
  # - path: /
  #   workload: my-workload
  #   port: 8080
  #   regexModifier: ""

Proxy Workload

  • proxyWorkload.image — Nginx container image.
  • proxyWorkload.port — Port Nginx listens on (default: 80).
  • proxyWorkload.capacityAI — Enable CapacityAI autoscaling on the proxy workload.
  • proxyWorkload.timeoutSeconds — Proxy connection timeout in seconds.

Resources

  • resources.cpu / resources.memory — CPU and memory allocated to each Nginx replica.

Autoscaling

  • autoscaling.minScale / autoscaling.maxScale — Minimum and maximum replica count.
  • autoscaling.maxConcurrency — Maximum number of concurrent connections per replica.

Routing

  • locations — Array of path-based routing rules. Each entry forwards matching requests to an internal workload:
FieldDescription
pathURL path prefix to match (e.g. /, /api)
workloadName of the target workload in the same GVC
portPort on the target workload to forward traffic to
regexModifierOptional regex modifier for path matching
Example:
locations:
  - path: /
    workload: my-app
    port: 8080
  - path: /api
    workload: my-api
    port: 3000

Built-in Endpoints

The following endpoints are always active regardless of your locations configuration:
EndpointBehavior
/healthReturns ok — used for liveness and readiness probes
/failReturns 500 — any 5XX errors from upstream workloads are returned as this response

Example Backend

  • enableExample — When true, deploys a sample helloworld backend workload and routes all traffic to it. Set to false when configuring your own locations.

Accessing the Proxy

Once deployed, the Nginx proxy is available at:
https://RELEASE_NAME-GVC_NAME.cpln.app

External References