{"id":19175841,"url":"https://github.com/handcraftedbits/docker-nginx-unit-go-import-redirector","last_synced_at":"2025-08-01T23:11:51.917Z","repository":{"id":95812273,"uuid":"63909800","full_name":"handcraftedbits/docker-nginx-unit-go-import-redirector","owner":"handcraftedbits","description":"A Docker container that provides a go-import-redirector unit for NGINX Host","archived":false,"fork":false,"pushed_at":"2017-02-17T03:13:57.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T08:46:24.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/handcraftedbits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-21T23:56:19.000Z","updated_at":"2016-07-21T23:57:12.000Z","dependencies_parsed_at":"2023-04-30T11:47:09.319Z","dependency_job_id":null,"html_url":"https://github.com/handcraftedbits/docker-nginx-unit-go-import-redirector","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/handcraftedbits/docker-nginx-unit-go-import-redirector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handcraftedbits%2Fdocker-nginx-unit-go-import-redirector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handcraftedbits%2Fdocker-nginx-unit-go-import-redirector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handcraftedbits%2Fdocker-nginx-unit-go-import-redirector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handcraftedbits%2Fdocker-nginx-unit-go-import-redirector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handcraftedbits","download_url":"https://codeload.github.com/handcraftedbits/docker-nginx-unit-go-import-redirector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handcraftedbits%2Fdocker-nginx-unit-go-import-redirector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268310800,"owners_count":24230186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T10:25:36.641Z","updated_at":"2025-08-01T23:11:51.492Z","avatar_url":"https://github.com/handcraftedbits.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NGINX Host go-import-redirector Unit [![Docker Pulls](https://img.shields.io/docker/pulls/handcraftedbits/nginx-unit-go-import-redirector.svg?maxAge=2592000)](https://hub.docker.com/r/handcraftedbits/nginx-unit-go-import-redirector)\n\nA [Docker](https://www.docker.com) container that provides a go-import-redirector unit for\n[NGINX Host](https://github.com/handcraftedbits/docker-nginx-host).\n\nThis container makes use of [rsc/go-import-redirector](https://github.com/rsc/go-import-redirector) to create a server\nfor custom [Go import paths](https://golang.org/cmd/go/#hdr-Remote_import_paths).\n\n# Usage\n\n## Configuration\n\nIt is highly recommended that you use container orchestration software such as\n[Docker Compose](https://www.docker.com/products/docker-compose) when using this NGINX Host unit as several Docker\ncontainers are required for operation.  This guide will assume that you are using Docker Compose.\n\nTo begin, start with a basic `docker-compose.yml` file as described in the\n[NGINX Host configuration guide](https://github.com/handcraftedbits/docker-nginx-host#configuration).  Then, add a\nservice for the NGINX Host go-import-redirector unit (named `redirector`):\n\n```yaml\nredirector:\n  image: handcraftedbits/nginx-unit-go-import-redirector\n  environment:\n    - NGINX_UNIT_HOSTS=mysite.com\n    - NGINX_URL_PREFIX=/go\n    - REDIRECTOR_IMPORT=mysite.com/go/*\n    - REDIRECTOR_REPO=https://github.com/mysite/*\n  volumes:\n    - data:/opt/container/shared\n```\n\nObserve the following:\n\n* Several environment variables are used to configure go-import-redirector.  See the\n  [environment variable reference](#reference) and\n  [go-import-redirector documentation](https://godoc.org/rsc.io/go-import-redirector) for additional information.\n* As with any other NGINX Host unit, we mount our data volume, in this case named `data`, to `/opt/container/shared`.\n\nFinally, we need to create a link in our NGINX Host container to the `redirector` container in order to host\ngo-import-redirector.  Here is our final `docker-compose.yml` file:\n\n```yaml\nversion: \"2.1\"\n\nvolumes:\n  data:\n\nservices:\n  proxy:\n    image: handcraftedbits/nginx-host\n    links:\n      - redirector\n    ports:\n      - \"443:443\"\n    volumes:\n      - data:/opt/container/shared\n      - /etc/letsencrypt:/etc/letsencrypt\n      - /home/me/dhparam.pem:/etc/ssl/dhparam.pem\n\n  redirector:\n    image: handcraftedbits/nginx-unit-go-import-redirector\n    environment:\n      - NGINX_UNIT_HOSTS=mysite.com\n      - NGINX_URL_PREFIX=/go\n      - REDIRECTOR_IMPORT=mysite.com/go/*\n      - REDIRECTOR_REPO=https://github.com/mysite/*\n    volumes:\n      - data:/opt/container/shared\n```\n\nThis will result in making go-import-redirector available at `https://mysite.com/go/*`.\n\n## Running the NGINX Host go-import-redirector Unit\n\nAssuming you are using Docker Compose, simply run `docker-compose up` in the same directory as your\n`docker-compose.yml` file.  Otherwise, you will need to start each container with `docker run` or a suitable\nalternative, making sure to add the appropriate environment variables and volume references.\n\n# Reference\n\n## Environment Variables\n\n### `REDIRECTOR_IMPORT`\n\nUsed to specify the import path pattern.  For example, `mysite.com/go/*`.\n\n**Required**\n\n### `REDIRECTOR_REPO`\n\nUsed to specify the underlying repository URL that hosts Go code.\n\n**Required**\n\n### `REDIRECTOR_VCS`\n\nUsed to specify which version control system is represented by the underlying repository URL.\n\n**Default**: `git`\n**Acceptable values**: `git`, `hg`, `svn`\n\n### Others\n\nPlease see the NGINX Host [documentation](https://github.com/handcraftedbits/docker-nginx-host#units) for information\non additional environment variables understood by this unit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandcraftedbits%2Fdocker-nginx-unit-go-import-redirector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandcraftedbits%2Fdocker-nginx-unit-go-import-redirector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandcraftedbits%2Fdocker-nginx-unit-go-import-redirector/lists"}