Sign inSign up

showfom/www-redirect

By showfom

•Updated 10 months ago

Redirects www. subdomains to their non-www equivalents over HTTPS with 301 status code.

Image
Networking
Web servers
0

950

showfom/www-redirect repository overview

⁠www-redirect

A lightweight Go service that redirects www. subdomains to their non-www equivalents over HTTPS with 301 status code.

⁠Example

http://www.example.com/path → https://example.com/path

⁠Features

  • Strips www. prefix and redirects to HTTPS
  • Validates domains using Public Suffix List
  • Rejects invalid domains and bare public suffixes
  • Minimal Docker image using scratch base

⁠Quick Start

docker compose up -d
⁠Build from Source
go build -o www-redirect .
./www-redirect

Service listens on 0.0.0.0:8080.

⁠Deployment

This service is designed to run behind a reverse proxy (e.g., nginx) that handles SSL termination. See nginx.conf.example for configuration reference.

⁠License

MIT

⁠Source Code

https://git.m.ac/showfom/www-redirect⁠

Tag summary

Content type

Image

Digest

sha256:cc2b6a470…

Size

2.3 MB

Last updated

10 months ago

docker pull showfom/www-redirect