{"id":15198726,"url":"https://github.com/olivere/sslserve","last_synced_at":"2025-04-10T10:12:44.603Z","repository":{"id":140121775,"uuid":"193229172","full_name":"olivere/sslserve","owner":"olivere","description":"Go service, scaled and proxied behind NGINX, using Docker Compose.","archived":false,"fork":false,"pushed_at":"2019-06-22T12:46:21.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-01T19:00:55.599Z","etag":null,"topics":["docker","docker-compose","go","golang","nginx","proxy","scaleable","ssl"],"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/olivere.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}},"created_at":"2019-06-22T12:01:53.000Z","updated_at":"2024-06-19T10:36:05.807Z","dependencies_parsed_at":"2023-07-25T12:45:33.250Z","dependency_job_id":null,"html_url":"https://github.com/olivere/sslserve","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/olivere%2Fsslserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivere%2Fsslserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivere%2Fsslserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivere%2Fsslserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olivere","download_url":"https://codeload.github.com/olivere/sslserve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198888,"owners_count":21063628,"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":["docker","docker-compose","go","golang","nginx","proxy","scaleable","ssl"],"created_at":"2024-09-28T01:40:27.643Z","updated_at":"2025-04-10T10:12:44.573Z","avatar_url":"https://github.com/olivere.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scaled service on Docker via SSL \n\nThis repository is an example of using a Go service behind\nan NGINX webserver that is accessible via HTTPS/SSL on\n\u003chttps://localhost:443\u003e. It also illustrates how to scale\na service in local development with Docker Compose.\n\n## Getting started\n\nFirst, you need to create an SSL certificate as described\non [Let's Encrypt](https://letsencrypt.org/docs/certificates-for-localhost/)\nfor `localhost:443`.\n\n```sh\nopenssl req -x509 -out etc/nginx/localhost.crt -keyout etc/nginx/localhost.key \\\n  -newkey rsa:2048 -nodes -sha256 \\\n  -subj '/CN=localhost' -extensions EXT -config \u003c( \\\n   printf \"[dn]\\nCN=localhost\\n[req]\\ndistinguished_name = dn\\n[EXT]\\nsubjectAltName=DNS:localhost\\nkeyUsage=digitalSignature\\nextendedKeyUsage=serverAuth\")\n```\n\nNext, follow these steps:\n\n1. `make build` will create the Go binary `./service`.\n2. `docker-compose up --build -d` will download, build, and\n   start the application.\n3. Open \u003chttps://localhost:443\u003e and accept the warning the\n   browser will give you. You should read the current time\n   every time the browser refreshes the page.\n\nBy default, only one instance of the service is running.\nSo if you `curl https://localhost:443` multiple times, it\nwill also print the same hostname.\n\nBut you can scale multiple instances of the service by\ninvoking e.g.:\n\n```sh\ndocker-compose up --scale service=3\n```\n\nThat will create 3 identical instances of the service\nwhich NGINX will proxy to all of them.\n\nWhen you now `curl https://localhost:443` multiple times, and\nit should print different hostnames. Notice that it may take\nup to 30 seconds (as defined in the NGINX configuration file)\nfor the DNS resolver to purge its cache.\n\nThis works by using the default DNS resolver that Docker creates\nby default on `127.0.0.11`.\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivere%2Fsslserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivere%2Fsslserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivere%2Fsslserve/lists"}