{"id":29188103,"url":"https://github.com/sebastienheyd/docker-self-signed-proxy-companion","last_synced_at":"2025-08-18T04:06:56.732Z","repository":{"id":41305041,"uuid":"151715500","full_name":"sebastienheyd/docker-self-signed-proxy-companion","owner":"sebastienheyd","description":"Self-signed certificate companion container for nginx-proxy","archived":false,"fork":false,"pushed_at":"2022-06-05T12:23:31.000Z","size":36,"stargazers_count":54,"open_issues_count":1,"forks_count":18,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T15:17:05.619Z","etag":null,"topics":["alpine","docker","docker-compose","docker-gen","dockerfile","nginx","nginx-proxy"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/sebastienheyd.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":"2018-10-05T12:11:33.000Z","updated_at":"2025-05-07T10:35:56.000Z","dependencies_parsed_at":"2022-09-22T15:42:29.348Z","dependency_job_id":null,"html_url":"https://github.com/sebastienheyd/docker-self-signed-proxy-companion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sebastienheyd/docker-self-signed-proxy-companion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienheyd%2Fdocker-self-signed-proxy-companion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienheyd%2Fdocker-self-signed-proxy-companion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienheyd%2Fdocker-self-signed-proxy-companion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienheyd%2Fdocker-self-signed-proxy-companion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastienheyd","download_url":"https://codeload.github.com/sebastienheyd/docker-self-signed-proxy-companion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienheyd%2Fdocker-self-signed-proxy-companion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270940801,"owners_count":24671700,"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-18T02:00:08.743Z","response_time":89,"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":["alpine","docker","docker-compose","docker-gen","dockerfile","nginx","nginx-proxy"],"created_at":"2025-07-01T22:09:05.297Z","updated_at":"2025-08-18T04:06:56.707Z","avatar_url":"https://github.com/sebastienheyd.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker stars](https://img.shields.io/docker/image-size/sebastienheyd/self-signed-proxy-companion.svg?sort=semver)](https://hub.docker.com/repository/docker/sebastienheyd/self-signed-proxy-companion)\n[![Docker pulls](https://img.shields.io/docker/pulls/sebastienheyd/self-signed-proxy-companion.svg)](https://hub.docker.com/repository/docker/sebastienheyd/self-signed-proxy-companion)\n\n# Self-signed certificate companion for Nginx-Proxy\n\n**WARNING ! Self-signed certificates should only be used on local projects !**\n\nself-signed-certificate-nginx-proxy-companion is a lightweight companion container for the [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy). It allows the creation of self-signed certificates automatically.\n\nIf you need to set Let's Encrypt certificates for production, see : [acme-companion](https://github.com/nginx-proxy/acme-companion).\n\n## Features\n\n* Automatic creation self-signed certificates with a **10 years validity period** (by default) using original [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) container.\n* Automatic creation of a certificate autority (CA) to trust your self-signed certificates\n\n## Usage\n\nTo use it with original [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) container you must declare 2 volumes :\n\n* `/var/run/docker.sock` (read only) to access docker socket\n* `/etc/nginx/certs` (writable) to create self-signed certificates\n\n#### Example:\n\n* First start nginx with the 2 volumes declared:\n```bash\n$ docker run -d -p 80:80 -p 443:443 \\\n    --name nginx-proxy \\\n    -v /var/run/docker.sock:/tmp/docker.sock:ro \\\n    -v /path/to/certs:/etc/nginx/certs:ro \\\n    -v /etc/nginx/vhost.d \\\n    nginxproxy/nginx-proxy\n```\n\n* Second start this container:\n```bash\n$ docker run -d \\\n    --name proxy-companion \\\n    -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n    -v /path/to/certs:/etc/nginx/certs:rw \\\n    sebastienheyd/self-signed-proxy-companion\n```\n\n* Then start any proxied containers with an additional env var `SELF_SIGNED_HOST`\n\n```bash\n$ docker run -d \\\n    --name example-app \\\n    -e \"VIRTUAL_HOST=example.com.localhost,www.example.com.localhost,mail.example.com.localhost\" \\\n    -e \"SELF_SIGNED_HOST=example.com.localhost\" \\\n    tutum/apache-php\n```\n**Note** : in this example `SELF_SIGNED_HOST` value `example.com.localhost` will cover `*.example.com.localhost`, you don't have to add all FQDN. See [wildcard](https://github.com/nginx-proxy/nginx-proxy#wildcard-certificates) documentation.\n\n#### With docker-compose :\n\nFirst start nginx and companion with the 2 volumes declared:\n\n```yml\nversion: '2'\n\nservices:\n    proxy:\n        container_name: proxy\n        restart: always\n        image: nginxproxy/nginx-proxy\n        ports:\n            - \"80:80\"\n            - \"443:443\"\n        volumes:\n            - /var/run/docker.sock:/tmp/docker.sock:ro\n            - ./vhost.d:/etc/nginx/vhost.d\n            - ./certs:/etc/nginx/certs:ro\n        networks:\n            - proxy\n\n    proxy-companion:        \n        container_name: proxy-companion\n        restart: always\n        image: sebastienheyd/self-signed-proxy-companion\n        volumes:\n            - /var/run/docker.sock:/var/run/docker.sock:ro\n            - ./certs:/etc/nginx/certs:rw\n\nnetworks:\n    proxy:\n        external: true\n```\n\nThen start any proxied containers with an additional env var `SELF_SIGNED_HOST`\n\n```yml\nversion: '2'\n\nservices:\n    app:\n        container_name: example-app\n        image: tutum/apache-php:latest\n        environment:\n            VIRTUAL_HOST: \"example.com.localhost,www.example.com.localhost,mail.example.com.localhost\"\n            SELF_SIGNED_HOST: \"example.com.localhost\"\n        networks:\n            - proxy\n\nnetworks:\n    proxy:\n        external: true\n```\n\n**Note** : in this example `SELF_SIGNED_HOST` value `example.com.localhost` will cover `*.example.com.localhost`, you don't have to add all FQDN. See [wildcard](https://github.com/nginx-proxy/nginx-proxy#wildcard-certificates) documentation.\n\n## Environment variables\n\n| Variable | Default value | Description |\n| --- | --- | --- |\n| NGINX_PROXY_CONTAINER | proxy | nginxproxy/nginx-proxy container name |\n| EXPIRATION | 3650 | Certificates validity period (in days) |\n| DOCKER_HOST | unix:///var/run/docker.sock | Path to the docker sock in current container |\n\n## Trust self-signed certificates\n\nThis will avoid you to see the alert \"your connection is not private\".\n\nAt the first launch of companion a CA certificate is generated. You will find `ca.crt` in your `certs` folder, this is your CA certificate.\n\nThere are several ways to import a CA certificate, here are two of them.\n\n##### Chrome\n\nFor MacOS:\n- open `Keychain Access`\n- drag and drop `ca.crt`\n- double clik certificate (can be found by typing `nginx` in search box)\n- expand `Trust` in first dropdown select `Always Trust`\n\nOther:\n- Go to : `chrome://settings/certificates`\n- Go to `Authorities` and import `ca.crt`\n- Check `Trust the CA to identify websites`\n\nA quicker solution, but less secure, is to allow insecure certificates for `*.localhost` domains : `chrome://flags/#allow-insecure-localhost`\n\n##### Firefox\n\n- Go to `about:config#privacy` or to `about:preferences#privacy` in newer versions\n- At the bottom of the page, click on `View certificates`, select `Authorities` \u003e `Import` then browse to `ca.crt`.\n- Check `Trust the CA to identify websites`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienheyd%2Fdocker-self-signed-proxy-companion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastienheyd%2Fdocker-self-signed-proxy-companion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienheyd%2Fdocker-self-signed-proxy-companion/lists"}