{"id":23404821,"url":"https://github.com/kimdcottrell/localdev-proxy","last_synced_at":"2026-02-18T09:01:55.621Z","repository":{"id":191977752,"uuid":"682231016","full_name":"kimdcottrell/localdev-proxy","owner":"kimdcottrell","description":"A reverse proxy for Dockerized localdev purposes, powered by Traefik 3 and Docker","archived":false,"fork":false,"pushed_at":"2024-12-06T05:11:38.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T14:20:02.228Z","etag":null,"topics":["docker","docker-compose","https","localdev","localdevelopment","mkcert","reverse-proxy","self-signed-certificate","traefik"],"latest_commit_sha":null,"homepage":"","language":null,"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/kimdcottrell.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-23T18:17:50.000Z","updated_at":"2025-09-01T22:41:57.000Z","dependencies_parsed_at":"2025-07-08T18:48:02.991Z","dependency_job_id":"4d03a258-76e4-4552-92c5-9dd294ef7fc1","html_url":"https://github.com/kimdcottrell/localdev-proxy","commit_stats":null,"previous_names":["kimdcottrell/localdev-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kimdcottrell/localdev-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdcottrell%2Flocaldev-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdcottrell%2Flocaldev-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdcottrell%2Flocaldev-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdcottrell%2Flocaldev-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimdcottrell","download_url":"https://codeload.github.com/kimdcottrell/localdev-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdcottrell%2Flocaldev-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29574065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","docker-compose","https","localdev","localdevelopment","mkcert","reverse-proxy","self-signed-certificate","traefik"],"created_at":"2024-12-22T13:16:13.429Z","updated_at":"2026-02-18T09:01:55.585Z","avatar_url":"https://github.com/kimdcottrell.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTPS for Docker localdevs\n\nSometimes, you want to use domain names for your local development containers. And you want them to be TLS-enabled. And you want to run many webservers across different projects at a time, all with domain names and no ports.\n\nHere is how to do it.\n\n## DO THIS FIRST\n\nInstall this: https://github.com/FiloSottile/mkcert \n\nRun this:\n\n```\ncd certs\nmkcert -install\nmkcert -key-file wildcard-local-dev-key.pem -cert-file wildcard-local-dev-cert.pem *.local.dev\n```\n\n## Important notes\n\nFor every webserver container you intend to proxy back to this, add this to `/etc/hosts`:\n\n```\n# tab delimit this, and change out the \"my-site-name-here\" with whatever you want\n127.0.0.1    my-site-name-here.local.dev\n```\n\nSadly, `/etc/hosts` does not allow for wildcards. If you want wildcards so you never have to do this again, check out `dnsmasq`.\n\n## Starting this reverse proxy and accessing the admin panel\n\nFirstoff, if you're running any webserver directly on your local machine, shut it down. It will cause port conflict errors.\n\nWith that done, add these domains to `/etc/hosts`. This may require `sudo`:\n\n```\n127.0.0.1   admin.traefik\n127.0.0.1   whoami.traefik\n```\n\nNow you'e good to go. Run:\n\n`docker compose up --build` (possibly with `-d` if you want to run this in the background so you can still use that terminal window)\n\nAnd if things are working correctly, you should:\n\n1. Be able to hit `http://admin.traefik` in your browser and see the Traefik dashboard\n2. Be able to visit `http://whoami.traefik` in your browser (or curl for this one) and see an echoserver response\n\n## How to use with your application's local development docker-compose.yml\n\nAdd in your desired domain name to your `/etc/hosts`. This may require `sudo`. For example:\n\n`127.0.0.1\tsomething.local.dev`\n\nIn your OTHER `docker-compose.yml` file, where your application stack lives, edit things so the traefik labels are included, but alter `webserverlocaldev` to whatever you want it to be, and alter `traefik.http.services.webserverlocaldev.loadbalancer.server.port` to be the `EXPOSE`'d port inside your `Dockerfile` for that container's image. Make sure you also include the `networks` value and the reference to this container stack's externally-presenting network so your application stack can access it. \n\n```\n# Changeable substrings: `webserverlocaldev`, `webserver`, `webserver.local.dev`, `8001`\nservices:\n  webserver:\n    ...\n    networks:\n      - default\n      - proxy\n    ...\n    labels:\n      # Explicitly tell Traefik to expose this container\n      - traefik.enable=true\n      # Tell Traefik you are planning a redirection, and to include the needed middleware\n      - traefik.http.middlewares.webserverlocaldev-redirect-web-secure.redirectscheme.scheme=https\n      - traefik.http.routers.webserverlocaldev.middlewares=webserverlocaldev-redirect-web-secure\n      # The domain the service will respond to, and what is in your /etc/hosts\n      - traefik.http.routers.webserverlocaldev-web.rule=Host(`webserver.local.dev`)\n      # Allow request only from the predefined entry point named \"web\"\n      - traefik.http.routers.webserverlocaldev-web.entrypoints=web # this is working with the port 80 entrypoint in the traefik config (a different docker-compose.yml)\n      # Let's redirect!\n      - traefik.http.routers.webserverlocaldev-web-secure.rule=Host(`webserver.local.dev`)\n      - traefik.http.routers.webserverlocaldev-web-secure.tls=true\n      - traefik.http.routers.webserverlocaldev-web-secure.entrypoints=web-secure\n      # What is essentially in this container's Dockerfile or image's Dockerfile under the `EXPOSE` setting\n      - traefik.http.services.webserverlocaldev-web-secure.loadbalancer.server.port=80 # this can be anything, but mirror the change back to the Dockerfile via EXPOSE\n\nnetworks:\n  # Creating our own network allows us to connect between containers using their service name.\n  default:\n    driver: bridge\n  proxy:\n    external: true\n```\n\nAnd if all goes well, you should be able to visit `https://app.local.dev` or whatever your domain name was in your browser instead of the usual `http://localhost:1337` or whatever port you picked. \n\nAn example of this in action is available here: https://github.com/kimdcottrell/wordpress-localdev-template/blob/main/docker-compose.yml \n\n# Relevant blog articles \n\n[How to use Traefik Proxy without exposing the Docker socket (HTTP Filter Edition)](https://kimdcottrell.com/posts/how-to-use-traefik-proxy-without-docker-socket-exposed-http-filter-edition/)\n\n[5 simple steps to achieving https and domain names for Docker localdev environments](https://kimdcottrell.com/posts/5-steps-to-achieving-https-and-domain-names-for-docker-local-development-envs/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimdcottrell%2Flocaldev-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimdcottrell%2Flocaldev-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimdcottrell%2Flocaldev-proxy/lists"}