{"id":16777876,"url":"https://github.com/mschae/dockxy","last_synced_at":"2025-08-23T04:16:30.307Z","repository":{"id":143070214,"uuid":"24475019","full_name":"mschae/dockxy","owner":"mschae","description":"Automatic nginx reverse-proxy config generation tool for (boot2)docker","archived":false,"fork":false,"pushed_at":"2014-12-29T11:26:54.000Z","size":3277,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T05:44:43.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mschae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-25T20:58:23.000Z","updated_at":"2019-09-27T19:01:17.000Z","dependencies_parsed_at":"2023-03-16T10:21:09.312Z","dependency_job_id":null,"html_url":"https://github.com/mschae/dockxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Fdockxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Fdockxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Fdockxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Fdockxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mschae","download_url":"https://codeload.github.com/mschae/dockxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918631,"owners_count":20368745,"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","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-10-13T07:26:08.337Z","updated_at":"2025-03-16T19:19:07.510Z","avatar_url":"https://github.com/mschae.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockxy\n\nDockxy is a nginx config file generator for docker files.\n\nMy biggest pain when I started with docker was working with a SOA.\nDocker assigns random ports to exposed ports of containers. Therefore\ntalking to those endpoints required me to look up the ports using `docker ps -a`,\nfeeding them into other Apps, etc.\n\nWith Dockxy you can listen to docker events (e.g. creation or deletion of new\ncontainers) and automatically create nginx config files to reverse-proxy from\nnginx to those containers.\n\nThe port and the IP as well as the name of the container will automatically be\nfilled in.\n\n## Running\n\nYou can download the pre-built binary. Or you can build it yourself by running\n`go build`.\n\nThe following runtime flags are available:\n\nFlag         | Meaning | Default\n-------------|-------- | -------\ndockerIP     | The IP address of the docker host                | 192.168.59.103 (boot2docker default)\ndockerURL    | The address to docker (e.g. tcp://10.0.0.1:1234) | tcp://192.168.59.103:2375\ntemplatePath | Path to the nginx template                       | templates/site.tmpl\noutDir       | Directory for the generated config files         | out\n\nThey are all optional. If you're using `boot2docker` there is a good chance all\nyou have to do is `sudo ./dockxy`\n\nFinally, add the following to your `nginx.conf` (ideally near the last closing\nbracket):\n\n```\ninclude /path/to/your/outDir/*;\n```\n\n## Caveats\n\n* The outDir will be cleaned on each run. This means all files inside will be deleted.\n* Since the program reloads nginx, you will most likely have to run it as root.\n\n## Example\n\nGiven dockxy is running.\n\nRunning\n\n```\ndocker up --name foo -P some/container\ndocker up --name bar -P some/other_container\n```\n\nWill automatically generate the following config files:\n\nfoo.conf\n\n\n```\nupstream foo.dev {\n  server 192.168.59.103:49158;\n}\n\nserver {\n  listen 80;\n  server_name foo.dev *.foo.dev;\n\n  client_max_body_size 50M;\n  error_page 500 502 503 504 /50x.html;\n\n  location = /50x.html {\n    root html;\n  }\n\n  try_files $uri/index.html $uri @foo.dev;\n  location @foo.dev {\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header Host $http_host;\n    proxy_redirect off;\n    proxy_pass http://foo.dev;\n    add_header Access-Control-Allow-Origin *;\n  }\n}\n```\n\nbar.conf\n\n```\nupstream bar.dev {\n  server 192.168.59.103:49159;\n}\n\nserver {\n  listen 80;\n  server_name bar.dev *.bar.dev;\n\n  client_max_body_size 50M;\n  error_page 500 502 503 504 /50x.html;\n\n  location = /50x.html {\n    root html;\n  }\n\n  try_files $uri/index.html $uri @bar.dev;\n  location @bar.dev {\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header Host $http_host;\n    proxy_redirect off;\n    proxy_pass http://bar.dev;\n    add_header Access-Control-Allow-Origin *;\n  }\n}\n```\n\nSo we can just do `curl foo.bar` and it'll direct us inside the container.\n\nCool huh?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschae%2Fdockxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmschae%2Fdockxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschae%2Fdockxy/lists"}