Legacy Support Team
Technical

GoProxy: Hosting Static and Dynamic Sites with Ease

Jan 3, 20258 min read
GoProxy architecture for hosting static and dynamic sites

GoProxy: Hosting Static and Dynamic Sites with Ease

In the quest for digital sovereignty, organizations are increasingly turning to open-source tools to regain control over their infrastructure. One such tool is GoProxy, a lightweight, feature-rich HTTPS reverse proxy server written in Go. With its automatic SSL certificate management, multi-domain support, and seamless integration of static and dynamic content, GoProxy empowers you to host your websites and applications securely and independently.

In this post, we’ll explore how GoProxy can help you achieve digital sovereignty by providing a robust, self-hosted solution for managing your web infrastructure.

Why GoProxy Supports Digital Sovereignty

GoProxy embodies the principles of digital sovereignty by:

  • Eliminating Vendor Lock-In: Host your sites and applications without relying on proprietary platforms.
  • Providing Full Transparency: As an open-source tool, GoProxy gives you complete visibility into its operations.
  • Ensuring Security: Automatic SSL certificates and robust logging keep your infrastructure secure.
  • Enabling Customization: Tailor your hosting setup to meet your unique needs.

By adopting GoProxy, you take a significant step toward achieving digital sovereignty and reclaiming control over your digital assets.

Take Control of Your Web Infrastructure

Digital sovereignty starts with the tools you use. GoProxy offers a powerful, open-source solution for hosting static and dynamic sites, enabling you to build a secure, independent web infrastructure.

Ready to get started? Visit the GoProxy GitHub repository to download the tool and explore its features.

At Legacy Support Team, we’re here to help you achieve digital sovereignty with open-source solutions like GoProxy. Contact us today to learn how we can support your journey toward independence and innovation.

Why GoProxy?

GoProxy is designed with simplicity and performance in mind. It combines the power of Go’s concurrency model with essential features for modern web hosting, including:

  • Automatic SSL/TLS Certificates: Leveraging Let’s Encrypt, GoProxy ensures your sites are always secure with minimal configuration.
  • Multi-Domain Support: Host multiple domains on a single server, each with its own configuration.
  • Static and Dynamic Content: Serve static files and proxy dynamic requests to backend services seamlessly.
  • WebSocket Support: Enable real-time communication for modern applications.
  • Detailed Logging: Monitor your infrastructure with comprehensive logs.

By using GoProxy, you can break free from proprietary hosting solutions and take full control of your web infrastructure.

Getting Started with GoProxy

Step 1: Installation

GoProxy is easy to install using Go:

go install github.com/d0rc/goproxy@latest

Step 2: Configuration

Create a configuration file (config.txt) to define your domains and routing rules. Here’s an example:

# Main website
domain=example.com
static_dir=/var/www/example
proxy=/api http://localhost:8080
proxy=/socket ws://localhost:8081
fallback_path=/index.html

# Admin panel
domain=admin.example.com
static_dir=/var/www/admin
auth=adminuser strongpassword

In this configuration:

  • example.com serves static files from /var/www/example and proxies API requests to http://localhost:8080.
  • admin.example.com serves static files from /var/www/admin and requires Basic Authentication.

Step 3: Running the Server

Start GoProxy with your configuration file:

goproxy -config config.txt

That’s it! GoProxy will automatically handle SSL certificates and start serving your sites.

Key Features in Action

1. Automatic SSL/TLS Certificates

GoProxy integrates with Let’s Encrypt to provide free, automatic SSL certificates. Certificates are cached locally and renewed 30 days before expiration, ensuring uninterrupted service.

2. Static File Serving

Serve static files for each domain with clean URLs and automatic index file handling. For single-page applications (SPAs), use the fallback_path option to route all requests to your main HTML file.

3. Reverse Proxy for Dynamic Content

Proxy requests to backend services with ease. For example:

proxy=/api http://localhost:8080
proxy=/socket ws://localhost:8081

This configuration routes /api requests to a backend API and /socket requests to a WebSocket service.

4. WebSocket Support

GoProxy seamlessly upgrades HTTP connections to WebSocket, enabling real-time communication for modern applications.

5. Detailed Logging

Monitor your infrastructure with detailed logs, including request timing, certificate management, and error tracking.

Production Deployment

For production use, follow these best practices:

  1. Systemd Service: Create a systemd service to manage GoProxy as a background process.
[Unit]
Description=GoProxy HTTPS Reverse Proxy
After=network.target

[Service]
Type=simple
User=goproxy
ExecStart=/usr/local/bin/goproxy -config /etc/goproxy/config.txt
Restart=always
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
  1. Firewall Configuration: Open ports 80 (HTTP) and 443 (HTTPS) on your server.
  2. Log Rotation: Set up log rotation to manage log files efficiently.
  3. Security Headers: Configure appropriate security headers to protect your sites.

Let's Talk About Your Project

Whether you need help with maintenance, updates, or planning for the future, we're here to listen and help however we can.