{"id":17862169,"url":"https://github.com/jtblin/nginx-k8s","last_synced_at":"2026-02-02T08:32:37.756Z","repository":{"id":66185152,"uuid":"47915579","full_name":"jtblin/nginx-k8s","owner":"jtblin","description":"nginx reverse proxy for kubernetes which automagically serves all services based on their domain name.","archived":false,"fork":false,"pushed_at":"2015-12-13T11:34:19.000Z","size":3,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T04:40:21.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nginx","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtblin.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}},"created_at":"2015-12-13T11:01:31.000Z","updated_at":"2024-02-01T23:32:48.000Z","dependencies_parsed_at":"2023-02-20T00:00:38.553Z","dependency_job_id":null,"html_url":"https://github.com/jtblin/nginx-k8s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jtblin/nginx-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtblin%2Fnginx-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtblin%2Fnginx-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtblin%2Fnginx-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtblin%2Fnginx-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtblin","download_url":"https://codeload.github.com/jtblin/nginx-k8s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtblin%2Fnginx-k8s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29007993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T08:20:25.892Z","status":"ssl_error","status_checked_at":"2026-02-02T08:20:04.345Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-10-28T08:50:48.376Z","updated_at":"2026-02-02T08:32:37.740Z","avatar_url":"https://github.com/jtblin.png","language":"Nginx","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx-k8s\n\nSimple nginx reverse proxy for [kubernetes](http://kubernetes.io) which automagically serves all services\ndeployed on k8s based on domain name.\n\n## Usage\n\n    git clone git@github.com:jtblin/nginx-k8s.git\n\nUpdate \"mydomain.tld\" in [default.conf](./default.conf) with your domain name: \n\n    \"~^(www\\.)?(?\u003csub_domain\u003e.+)\\.mydomain\\.tld$\";\n\nBuild the docker image:\n\n    docker build -t myrepo/nginx-k8s .\n\nUpdate the `PROXY_DOMAIN` environment variable in [nginx-k8s.yaml](./nginx-k8s.yaml) with the url of your k8s api \nserver, the image name, and create the replication and service controller.\n\n    docker push myrepo/nginx-k8s\n    kubectl create -f nginx-k8s.yaml\n\nFind the node ports (`NodePort`) of your `nginx-k8s` service:\n\n    kubectl describe svc nginx\n\nCreate a load balancer including all kubernetes nodes (not the master) with a listener on the `http` node port.\nYou can terminate SSL on the ELB and add a healthcheck pointing to the `health` NodePort of the `nginx` service\nfor the path `/healthz`.\n\nDeploy services to your kubernetes cluster, and set their domain name in your registar pointing to the \nload balancer created above. The subdomain part of the FQDN needs to be the same as the k8s service name. Profit!\n\n## Specs, caveats and rationale\n\n* The image is based on `alpine` linux so it is quite small (15Mb). \n* This works because services are accessible on k8s at `/api/v1/proxy/namespaces/default/services/\u003cservice-name\u003e`.\n* This config will only work for the `default` namespace. If you want to use a different namespace, update accordingly.\n* This only works for services that expose only one port. If you need to expose more ports, just create more services.\n* The overhead of going through the kube proxy might not be suitable for production use.\n* This was done in anger because of the limitations with the current `LoadBalancer` type in k8s.\n* Requires DaemonSets extension (from v1.1): http://kubernetes.io/v1.1/docs/admin/daemons.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtblin%2Fnginx-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtblin%2Fnginx-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtblin%2Fnginx-k8s/lists"}