GRPC Reverse Proxy

A simple gRPC reverse proxy using Caddy.

Deploy GRPC Reverse Proxy

grpc-reverse-proxy

monotykamary/grpc-reverse-proxy:latest

Just deployed

Deploy and Host gRPC Reverse Proxy on Railway

A lightweight gRPC reverse proxy using Caddy that forwards HTTP/2 Cleartext (h2c) traffic to backend gRPC services. Built on Alpine Linux for minimal resource usage while providing robust proxy capabilities for gRPC microservices architectures.

About Hosting gRPC Reverse Proxy

Hosting a gRPC reverse proxy provides a crucial infrastructure component for microservices architectures, enabling load balancing, SSL termination, and routing for gRPC services. Built with Caddy on Alpine Linux, this proxy efficiently handles HTTP/2 Cleartext connections and forwards them to designated backend gRPC services. The lightweight Docker-based solution offers simple configuration through environment variables, making it ideal for containerized deployments where you need to expose internal gRPC services through a unified entry point with minimal overhead.

Common Use Cases

  • Microservices API Gateway: Provide a single entry point for multiple gRPC services, enabling centralized routing and load balancing in microservices architectures
  • gRPC Service Exposure: Expose internal gRPC services to external clients while maintaining security and control over backend service access
  • Development and Testing: Create a consistent proxy layer for local development environments where gRPC services need to be accessible from different network contexts
  • Legacy System Integration: Bridge gRPC services with existing infrastructure that requires specific networking configurations or port mappings

Dependencies for gRPC Reverse Proxy Hosting

  • Backend gRPC Service: Target gRPC service that supports HTTP/2 Cleartext (h2c) protocol
  • Caddy Web Server: Lightweight web server with built-in reverse proxy capabilities (included in container)

Deployment Dependencies

Implementation Details

Required environment variables for deployment:

# Port Configuration
PORT=80  # Port Caddy listens on inside the container

# Backend Service
SERVICE_URL=your-grpc-service:50051  # Backend gRPC service URL

Example Caddyfile configuration:

:{$PORT}

reverse_proxy {$SERVICE_URL} {
    transport http {
        versions h2c
    }
}

Testing the proxy with grpcurl:

# Test the deployed proxy
grpcurl -plaintext your-proxy-url:port package.service.Method

# Example with specific service
grpcurl -plaintext localhost:8080 greeter.Greeter/SayHello

Why Deploy gRPC Reverse Proxy on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying gRPC Reverse Proxy on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh