Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk6 min

How to Build a Go Vanity Import Path with Caddy or Nginx

A Go vanity path needs a small HTML discovery response, not necessarily a module proxy. Learn how to map it to Git or a GOPROXY service with Caddy or Nginx.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Go vanity import path is a stable, domain-based name that tells Go where to find a module. Caddy or Nginx can serve the small HTML discovery response Go needs; they do not become a module proxy unless they also forward or implement the Go module proxy protocol. The key setup choice is whether the metadata points to a Git repository or to a GOPROXY-compatible module service.

How Go resolves a vanity import path

When Go encounters a module path such as go.example.com/team/tool, it requests that path over HTTP(S) and looks for a go-import meta tag in the returned HTML document’s <head>. The Go Modules Reference says: “The server must respond with an HTML document containing a <meta> tag in the document’s <head>.”

As an Amazon Associate I earn from qualifying purchases.

The tag has three required fields: the import-path root, a VCS name or mod, and a repository or proxy URL. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<meta name="go-import" content="go.example.com/team/tool git https://github.com/example/tool">

Here, git directs Go to the Git repository. A module-proxy mapping uses mod and names the service that speaks the Go module proxy protocol:

#1 Best Overall
Sale
GMKtec G3S Mini PC Intel N95 Processor (Up to 3.4GHz) 8GB RAM 256GB M.2 SSD | Mini Desktop Computer with VESA Mount for Office Home Business HTPC Proxmox, Dual 4K Display, WiFi 5, Gigabit Ethernet
  • 12th Intel Alder Lake N95 Processor – The GMKtec G3 S Mini PC is powered by the 12th Gen Intel N95 processor with 4 cores, 4 threads, 6MB cache and a burst frequency up to 3.4GHz. Compared with N100/N5105/N5100/N5095, the N95 delivers up to 36% overall performance improvement. Perfect for routine tasks, office work, and home entertainment, this compact mini desktop is more convenient than traditional bulky PCs.
  • 8GB RAM & 256GB SSD Storage – Pre-installed with 8GB DDR4 memory and a fast 256GB M.2 2242 SSD, the G3 S mini desktop offers quicker startup, smoother multitasking, and faster file transfers. Enjoy seamless performance whether you’re working on multiple applications, browsing, or streaming content.
  • Rich Interfaces & Connectivity – The G3 S mini computer comes equipped with USB 3.2 (up to 10Gbps), dual HDMI 2.0 (4K@60Hz), and a 3.5mm audio jack. With support for WiFi 5, Bluetooth 5.0, and Gigabit Ethernet (RJ45 1000MbE), it connects easily with monitors, projectors, printers, office equipment, and other peripherals, making it versatile for both home and business use.
  • Dual 4K Display Support – Featuring upgraded Intel UHD Graphics (up to 1000MHz), the G3 S supports 4K video playback and AV1 decoding for a smooth viewing experience. With dual HDMI outputs, you can connect two 4K@60Hz displays simultaneously, enabling efficient multitasking for work and entertainment.
  • GMKTEC WARRANTY - GMKtec offers a 3-year limited warranty (1 year replacement + 2 years parts replacement) for each mini PC, starting from the date of the purchase effective on all sales starting Oct. 2026. All defects due to design and workmanship are covered. With a professional after sales team always ready to attend to your needs, you can simply relax and enjoy your mini PC
<meta name="go-import" content="go.example.com/team/tool mod https://modules.example.com">

These domains and repository locations are illustrative. Replace them with values you control. The repository URL must include a scheme and must not include a .vcs qualifier.

Choose the backend before writing the response

  • Git mapping: Go uses the discovered repository URL to retrieve source. Use this when the vanity path should lead to a VCS repository.
  • mod mapping: Go makes module-protocol requests, such as version-list and archive requests, to the named module service. That service must actually support the GOPROXY protocol; a discovery page alone does not serve module archives.

A module proxy can be implemented separately—for example, the Go reference describes a minimal proxy serving module files from a module cache and using go mod download to obtain missing modules. The web-server examples below only provide discovery metadata.

Choose a response strategy

Decision Option Use it when
Discovery response Static HTML from Caddy or Nginx The mapping is fixed and does not need to vary by request.
Discovery response Generated HTML from an upstream app The metadata must vary by path or configuration and operating an application is worthwhile.
Module source VCS mapping such as git Go should retrieve source from a repository.
Module source mod mapping Go should retrieve module data from a GOPROXY-compatible service.
Front end Caddy or Nginx Choose based on your existing deployment and configuration conventions. The cited documentation does not establish a performance ranking.

Build a static discovery endpoint with Caddy

Caddy’s respond directive can return a fixed body. This illustrative Caddyfile returns the Git mapping for the exact path and its descendants:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
GEEKOM A5 2027 Edition Mini PC, Ryzen 7 7730U, 16GB RAM, 256GB NVMe SSD
  • [15W Ryzen 7 Agentic PC for Everyday Workflows] Powered by the AMD Ryzen 7 7730U processor (8 Cores, 16 Threads), the GEEKOM A5 is built for sustained productivity. It doubles as your cloud-native Agentic AI assistant, seamlessly hosting cloud AI tasks, automating office workflows, and handling intelligent document summarization without complex local deployment. Smoothly manage Microsoft Office, dozens of browser tabs, heavy Excel spreadsheets, and remote learning throughout your workday.
  • [Smart Value Now, Expandable for Tomorrow] Equipped with 16GB RAM and a fast 256GB PCIe NVMe SSD for snappy daily performance, the A5 offers incredible value. Need more space later? It features dual-slot DDR4 RAM (upgradable to 64GB) and supports an M.2 SSD up to 4TB. With an extra M.2 2242 slot and 2.5" HDD bay for up to 10TB total storage, you get the flexibility to scale your storage seamlessly as your needs grow, beating soldered LPDDR solutions.
  • [Multi-Display Connectivity for Maximum Productivity] Create a complete workstation with support for up to four displays through Dual HDMI and Dual USB-C ports, including up to 8K output via USB-C. Stay connected with Wi-Fi 6, Bluetooth 5.4, a 2.5GbE LAN port, SD card reader, and multiple USB ports for fast networking, efficient multitasking, and seamless connectivity across all your devices.
  • [Built to Stay Cool, Quiet & Reliable] More than fast, the GEEKOM A5 is built to last. A reinforced one-piece all-metal internal frame enhances structural strength, while the upgraded IceBlast 3.0 cooling system improves cooling efficiency by up to 42% with up to 35% greater airflow for quieter operation. Backed by 339 reliability tests and a 72-hour full-load aging test, it's engineered for dependable long-term performance.
  • 🏢[Business-Ready, Compact & Efficient] Pre-installed OS, the GEEKOM A5 supports Wake-on-LAN, Scheduled Power On, and Group Policy, making deployment and remote management simple for businesses. Its ultra-compact 0.6L design fits neatly behind monitors or into space-limited workstations while delivering excellent power efficiency for home offices, front desks, and commercial environments.
go.example.com {
    @tool path /team/tool /team/tool/*
    header @tool Content-Type text/html
    respond @tool "<!doctype html><html><head><meta name="go-import" content="go.example.com/team/tool git https://github.com/example/tool"><title>Go module discovery</title></head><body>Go module discovery endpoint</body></html>" 200
}

The response body is deliberately small. Keep the metadata near the start of the head, before any script or style content: Go uses a restricted parser and may not find a tag placed later. The mapping root here is go.example.com/team/tool, which is a prefix of requests such as go.example.com/team/tool/subpkg.

If you prefer a file rather than an inline response, Caddy’s file_server directive can serve a document from a site root. Ensure the requested discovery paths resolve to HTML containing the right tag; a general homepage that lacks it is not sufficient. For a generated response, use Caddy’s reverse_proxy directive to pass requests to an application that returns the metadata.

Caddy sorts directives by default, so configurations that combine matchers, rewrites, file serving, and proxying can behave differently from their textual order. Its route directive preserves literal handler order. Keep a static endpoint uncomplicated; when combining handlers, make their order explicit where needed and inspect the adapted configuration. Caddy’s reverse proxy passes incoming headers through by default, including Host, with exceptions for forwarded headers such as X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Host; do not assume these defaults match Nginx’s.

Rank #3
BOSGAME E5 11 Pro Mini PC, AMD Ryzen 5300U 4C/ 8T, Business Home Office PC | 8GB DDR4 256GB M.2 2280 SSD, 2.5 GbE Dual Lan Desktop Computers, Triple Displays 4K 60Hz, Wi-Fi 5, BT 5.0, Support Linux SSH
  • 【AMD Ryzen 3 5300U CPU: Outperforms N150 & 3500U】 BOSGAME E5 mini PC is powered by the TSMC 7nm FinFET architecture AMD Ryzen 3 5300U processor (4 Cores, 8 Threads, up to 3.8GHz boost, 6MB total cache). Compared to low-end Intel N150 or 3500U chips which only have 4 single threads and throttle under load, the 5300U delivers over 30% faster multi-core speed. Run 30+ browser tabs, large Excel sheets, and Zoom meetings simultaneously without system lag.
  • 【8GB DDR4 RAM & 256GB NVMe SSD Storage】 Installed with high-speed 8GB DDR4 dual-channel memory and a fast 256GB M.2 2280 SSD, eliminating slow boot times and application loading delays. To accommodate growing data requirements, the upgradeable hardware design features dual SODIMM slots that allow you to expand memory up to 64GB RAM, ensuring smooth operation during heavy multitasking.
  • 【High-Capacity Dual M.2 SSD Storage Expansion】 Never worry about running out of space for your business files. In addition to the pre-installed 256GB system drive, the motherboard houses an extra empty internal M.2 2280 NVMe PCIe 3.0 slot. This allows you to easily add a second solid-state drive for up to an additional 2TB of storage capacity (upgrades not included) without needing to remove or reinstall the original operating system.
  • 【Radeon 6-Core Graphics & Triple 4K Displays】 Integrated with official AMD Radeon Graphics (6 Graphics Cores, 1500 MHz frequency) for casual gaming, photo editing, and crisp 4K media decoding. Featuring 1x HDMI 2.0 port, 1x DisplayPort, and 1x Full-Function Type-C port, the E5 outputs true 4K@60Hz resolution to three monitors at once. This multi-screen setup eliminates constant window-switching for traders, programmers, and office workers.
  • 【Dual 2.5GbE LAN Ports for Advanced Networking】 Experience fast wired network transmission speeds up to 2500Mbps without lagging or buffering. The integration of dual 2.5 Gigabit Ethernet ports (powered by Realtek RTL8125 controller) makes this compact computer an exceptional hardware choice for tech enthusiasts. Easily configure it into software routers, hardware firewalls (pfSense, OpnSense), home NAS servers, or local homelabs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build a static discovery endpoint with Nginx

Nginx’s return directive can emit fixed HTML. This illustrative configuration uses separate locations for the exact root and paths beneath it, so the mapping also answers Go’s possible prefix-verification request:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    server_name go.example.com;

    location = /team/tool {
        default_type text/html;
        return 200 '<!doctype html><html><head><meta name="go-import" content="go.example.com/team/tool git https://github.com/example/tool"><title>Go module discovery</title></head><body>Go module discovery endpoint</body></html>';
    }

    location ^~ /team/tool/ {
        default_type text/html;
        return 200 '<!doctype html><html><head><meta name="go-import" content="go.example.com/team/tool git https://github.com/example/tool"><title>Go module discovery</title></head><body>Go module discovery endpoint</body></html>';
    }
}

The exact and descendant locations intentionally return the same metadata. If you instead generate the response in an application, Nginx’s proxy_pass directive can forward the request. Nginx’s core module documentation covers location selection and try_files, which may be useful when serving a file-based endpoint.

This is an illustrative server-block fragment, not a complete production deployment: TLS, certificate management, logging, access policy, and surrounding routing are environment-specific. Validate the configuration against the Nginx version and server block you actually deploy.

Rank #4
Dell OptiPlex 7050 Micro Computer, Intel Quad Core i5-6500T up to 3.1GHz, 16G DDR4, 256G SSD, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell OptiPlex 7050 Micro Computer, Intel Quad Core i5-6500T up to 3.1GHz, 16G DDR4, 256G SSD.
  • Includes: USB Keyboard & Mouse, Microsoft office 30 days free trail.
  • Ports: 1 x RJ-45, 1 x HDMI, 1 x DP, 6 x USB 3.0.
  • 4K Support: Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.

Make the path and metadata agree

The first tag field is the import-path root. It must exactly match the requested module path or be a valid prefix of it. If it is only a prefix, Go makes another request at that root to verify the metadata. That means the endpoint must return consistent metadata both for the deeper requested path and for the root verification request; serving the tag only at one of those URLs can break resolution.

A repository can also hold a module in a subdirectory. The optional subdirectory field in go-import metadata is recognized only by Go 1.25 and later. Earlier Go versions ignore it, so a module mapping that depends on this field requires Go 1.25+ among its users. If you need to support earlier versions, do not rely on that field for repository layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify discovery and module retrieval separately

  1. Check the endpoint response. Request both the full module path and the declared root, for example with curl -i https://go.example.com/team/tool and curl -i https://go.example.com/team/tool/subpkg. Confirm that the response is HTML and contains the same, correctly rooted tag near the start of the head. If the root equals the requested path, the second URL is not needed; otherwise check the prefix root too.
  2. Ask Go to resolve the module. From a temporary module or other suitable Go module context, run GOPROXY=direct go list -m -versions go.example.com/team/tool. This asks Go to use direct resolution rather than the configured module proxy. A successful metadata response does not by itself prove that the Git repository or module service contains usable versions.
  3. Check the selected backend. For a git tag, confirm that the repository URL is reachable and has the expected module path and versions. For mod, confirm that the named service responds to Go module-protocol requests. These are separate checks from whether the vanity endpoint serves its HTML correctly.
  4. Inspect failures at both layers. A missing or malformed tag points to the discovery response, a root/prefix mismatch points to path mapping, and a backend error points to the repository or proxy service. Review server and upstream logs alongside the HTTP responses.

Protect private module paths from unintended disclosure

Go’s default proxy configuration contacts proxy.golang.org before direct retrieval and sends the requested module path. Changing the vanity domain does not by itself prevent that disclosure. For private modules, configure Go’s privacy-related environment settings according to your organization’s policy. For example, GOPRIVATE=go.example.com/* marks matching paths as private and supplies defaults for GONOPROXY and GONOSUMDB; review those settings and any explicit overrides alongside your GOPROXY configuration. The Go Modules Reference documents how these settings affect proxy and checksum database use.

Use HTTPS for public vanity endpoints. The Go reference allows insecure schemes only when the module path matches GOINSECURE; that exception is not a substitute for HTTPS where secure transport is available.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.