Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit c6e7a1b

Browse files
committed
added workarounds for windows cert .nokey failure & moved the domain name injection to the build stage
1 parent af79b83 commit c6e7a1b

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

docker-compose-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ services:
1313
restart: always
1414
build:
1515
context: ./nginx-certbot
16+
args:
17+
DOMAIN: server.company.com
1618
environment:
17-
CERTBOT_EMAIL: [email protected]
18-
ENVSUBST_VARS: DOMAIN
19-
DOMAIN: server.company.com
19+
CERTBOT_EMAIL: [email protected]
2020
ports:
2121
- 80:80
2222
- 443:443

docker-compose-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ services:
1313
restart: always
1414
build:
1515
context: ./nginx-certbot
16+
args:
17+
DOMAIN: server.company.com
1618
environment:
17-
CERTBOT_EMAIL: [email protected]
18-
ENVSUBST_VARS: DOMAIN
19-
DOMAIN: server.company.com
19+
CERTBOT_EMAIL: [email protected]
2020
ports:
2121
- 80:80
2222
- 443:443

nginx-certbot/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
FROM staticfloat/nginx-certbot
22
COPY *.conf /etc/nginx/conf.d/
33

4+
ARG DOMAIN
5+
6+
RUN sed -i "s/DOMAIN/${DOMAIN}/g" /etc/nginx/conf.d/boiler.conf
47
RUN sed -i 's/acme-v01/acme-v02/g' /scripts/util.sh

nginx-certbot/boiler.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
server {
22
listen 443 ssl;
3-
server_name ${DOMAIN};
4-
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
5-
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
3+
server_name DOMAIN;
4+
ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
5+
ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
66

77
location / {
88
proxy_pass http://boiler:80;

readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ If you're behind Nginx or a similar reverse proxy setup, you can either:
7474

7575
Docker on Windows has an open issue with local volume mapping permissions, which results in PostgreSQL not being able to write to a (relative) local directory. Thus, when running on Windows (via run.sh), an external volume is created, which is managed by Docker.
7676

77+
Moreover, if you encounter a PR_END_OF_FILE_ERROR when trying to load the website, try executing:
78+
79+
```
80+
$ docker exec nginx bash -c "mv /etc/nginx/conf.d/boiler.conf{.nokey,} ; nginx -s reload"
81+
```
82+
83+
This seems to be a symlink issue with Windows Docker containers as well. After renaming the file once, it does not need to be touched anymore (unless you purge the nginx container).
84+
7785
### Information & Sources
7886

7987
Documentation for ASP.NET Core can be found here: [.NET Core docs.](https://docs.microsoft.com/aspnet/core)

0 commit comments

Comments
 (0)