Sign inSign up

jlcox1970/serve-proxy

By jlcox1970

•Updated 4 months ago

Static web server with reverse proxy, cache control, and Apache-style logging, written in Go.

Image
API management
Developer tools
Web servers
0

1.3K

jlcox1970/serve-proxy repository overview

https://gitlab.com/jlcox70/serve-proxy⁠

šŸ“¦ Go Static Web Server with Reverse Proxy and Apache Logging This lightweight and production-ready Go web server is designed to serve static web apps (like Vue.js builds), apply per-file Cache-Control headers, reverse proxy selected paths to backend services, and log all requests in Apache Common Log Format.

āœ… Features Static File Hosting — Serve compiled frontend apps from any path (configurable web_root)

Reverse Proxy — Forward API routes to HTTP/HTTPS backends with optional TLS validation

Cache Control — Set Cache-Control headers based on file extensions

Apache-style Logging — Logs all requests with real client IPs via X-Real-IP or X-Forwarded-For

Self-config Help Page — If web_root is not configured, responds with a setup guide

No Redirects — / and /web_root/ serve your index.html cleanly without 301s

Fully Dockerized — Lightweight final image using scratch or distroless

šŸ”§ Configuration Configure the server using a config.yaml file:

port: 8080
static_dir: "./dist"
web_root: "/app"
cache_control:
  ".js": "max-age=86400"
  ".html": "no-cache"
proxies:
  "/api":
    target: "https://api.example.com"
    insecure_skip_tls: true

šŸƒ Usage

docker run -v $(pwd)/dist:/app/dist \
           -v $(pwd)/config.yaml:/app/config.yaml \
           -e CONFIG_PATH=/app/config.yaml \
           -p 8080:8080 \
           go-web-server

Then open:

http://localhost:8080/⁠ → loads index.html

http://localhost:8080/app/⁠ → static frontend

http://localhost:8080/api/⁠... → proxied to backend

šŸ“„ License GPLv3 – See LICENSE for full details.

Tag summary

Content type

Image

Digest

sha256:161b87503…

Size

4.9 MB

Last updated

4 months ago

docker pull jlcox1970/serve-proxy:2.0.7