Skip to content

Commit 51a2640

Browse files
committed
[Bugfix] Fixed issue with ssl certificate renewal
1 parent f296eef commit 51a2640

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ docker run --network frontend \
1616
--name nginx-proxy \
1717
-v /var/run/docker.sock:/var/run/docker.sock:ro \
1818
-v /etc/ssl:/etc/ssl \
19-
-v /etc/ssl/dhparam:/etc/nginx/dhparam \
19+
-v /etc/nginx/dhparam:/etc/nginx/dhparam \
2020
-p 80:80 \
2121
-p 443:443 \
2222
-d --restart always mesudip/nginx-proxy
@@ -37,8 +37,8 @@ docker run --network frontend \
3737
```
3838
docker run --network frontend \
3939
--name docker-registry \
40-
-e VIRTUAL_HOST='registry.example.com/v2 -> /v2; client_max_body_size 2g' \
41-
-e PROXY_BASIC_AUTH="registry.example.com -> user1:password,user2:password2,user3:password3"
40+
-e VIRTUAL_HOST='https://registry.example.com/v2 -> /v2; client_max_body_size 2g' \
41+
-e PROXY_BASIC_AUTH="registry.example.com -> user1:password,user2:password2,user3:password3" \
4242
registry:2
4343
```
4444

@@ -176,6 +176,8 @@ Basic Auth can be enabled on the container with environment variable `PROXY_BASI
176176
- `PROXY_BASIC_AUTH=user1:password1,user2:password2,user3:password3` adds basic auth feature to your configured `VIRTUAL_HOST` server root.
177177
- `PROXY_BASIC_AUTH=example.com/api/v1/admin -> admin1:password1,admin2:password2` adds basic auth only to the location starting from `api/v1/admin`
178178

179+
**Note:** Basic authorization will be ignored if the container's host doesn't use `https`
180+
179181
## Default Server
180182
When request comes for a server name that is not registered in `nginx-proxy`, It responds with 503 by default.
181183
If you want the requested to be passed to a container instead, when setting up the container you can add `PROXY_DEFAULT_SERVER=true` environment along with `VIRTUAL_HOST`.

nginx_proxy/post_processors/ssl_certificate_processor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def update_ssl_certificates(self):
5050
for x in self.cache:
5151
print("Remaining days :", x, ":", (self.cache[x] - now).days)
5252
x = [x for x in self.cache if (self.cache[x] - now).days < 6]
53+
for host in x:
54+
del self.cache[host]
5355
self.server.reload()
5456

5557
def process_ssl_certificates(self, hosts: List[Host]):

0 commit comments

Comments
 (0)