Skip to content

Commit 0cc72e0

Browse files
committed
Merge branch 'master' into with-authelia
* master: Update README.md (evertramos#178) update error message Get start script to create .env file for new users update nginx.template Update README.md Add Beerpay's badge Reload Instructions update nginx.tmpl file Fix issue evertramos#113 (evertramos#124) update realip address with private intranets options Update README.md update folder name Support for running on Synology DSM Nas and configureable ports for docker host (evertramos#110) update NGINX_FILES_PATH (evertramos#108) Update README.md Update .env.sample Update README.md # Conflicts: # nginx.tmpl
2 parents 377aec3 + f772669 commit 0cc72e0

14 files changed

+178
-81
lines changed

.env.sample

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DOCKER_GEN=nginx-gen
2020
LETS_ENCRYPT=nginx-letsencrypt
2121

2222
#
23-
# Your external IP address
23+
# Set the IP address of the external access Interface
2424
#
2525
IP=0.0.0.0
2626

@@ -48,9 +48,11 @@ NETWORK=webproxy
4848
#SERVICE_NETWORK_OPTIONS="--opt encrypted=true"
4949

5050
#
51-
# NGINX file path
52-
#
53-
NGINX_FILES_PATH=/path/to/your/nginx/data
51+
## NGINX file path (mount into the host)
52+
# Here you can configure the path where nginx stores all the configurations and certificates.
53+
# With the value ./nginx-data it creates a new sub-folder into your current path.
54+
55+
NGINX_FILES_PATH=./nginx-data
5456

5557
#
5658
# NGINX use special conf files
@@ -89,3 +91,11 @@ NGINX_FILES_PATH=/path/to/your/nginx/data
8991
#NGINX_LETSENCRYPT_LOG_DRIVER=json-file
9092
#NGINX_LETSENCRYPT_LOG_MAX_SIZE=2m
9193
#NGINX_LETSENCRYPT_LOG_MAX_FILE=10
94+
95+
#
96+
# Set the local exposed ports for http and https on the Host
97+
#
98+
# NOTE: The default values are 80 and 443, only change this options if you really know what you are doing
99+
#
100+
#DOCKER_HTTP=80
101+
#DOCKER_HTTPS=443

.github/README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DOCKER_GEN=nginx-gen
5151
LETS_ENCRYPT=nginx-letsencrypt
5252
5353
#
54-
# Your external IP address
54+
# Set the IP address of the external access Interface
5555
#
5656
IP=0.0.0.0
5757
@@ -79,9 +79,11 @@ NETWORK=webproxy
7979
#SERVICE_NETWORK_OPTIONS="--opt encrypted=true"
8080
8181
#
82-
# NGINX file path
83-
#
84-
NGINX_FILES_PATH=/path/to/your/nginx/data
82+
## NGINX file path (mount into the host)
83+
# Here you can configure the path where nginx stores all the configurations and certificates.
84+
# With the value ./nginx-data it creates a new sub-folder into your current path.
85+
86+
NGINX_FILES_PATH=./nginx-data
8587
8688
#
8789
# NGINX use special conf files
@@ -200,12 +202,23 @@ Or as of below:
200202
docker run [...] -e VIRTUAL_PORT=8545 [...]
201203
```
202204

205+
4. Restarting proxy container
206+
207+
In some cases you will need to restart the proxy in order to read, as an example, the Basic Auth, if you set it after your service container is already up and running. So, the way I use to restart the proxy (NGINX) is as following, which has no downtime:
208+
209+
```bash
210+
docker exec -it ${NGINX_WEB} nginx -s reload
211+
```
212+
213+
Where *${NGINX_WEB}* is your proxy container name, which in the original `.env` file is set as *nginx-web*.
214+
215+
203216
## Testing your proxy with scripts preconfigured
204217

205218
1. Run the script `test.sh` informing your domain already configured in your DNS to point out to your server as follow:
206219

207220
```bash
208-
./test_start.sh your.domain.com
221+
./test_start_ssl.sh your.domain.com
209222
```
210223

211224
or simply run:
@@ -228,11 +241,18 @@ Or simply run:
228241
docker stop test-web && docker rm test-web
229242
```
230243

244+
## Running this Proxy on a Synology NAS
245+
246+
Please checkout this [howto](https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion/blob/master/docs/HOWTO-Synlogy.md).
247+
248+
231249
## Production Environment using Web Proxy and Wordpress
232250

233251
1. [docker-wordpress-letsencrypt](https://github.com/evertramos/docker-wordpress-letsencrypt)
234252
2. [docker-portainer-letsencrypt](https://github.com/evertramos/docker-portainer-letsencrypt)
235253
3. [docker-nextcloud-letsencrypt](https://github.com/evertramos/docker-nextcloud-letsencrypt)
254+
4. [docker-registry-letsencrypt](https://github.com/evertramos/docker-registry-letsencrypt)
255+
5. [gitlab-docker-letsencrypt](https://github.com/steevepay/gitlab-docker-letsencrypt)
236256

237257
In this repo you will find a docker-compose file to start a production environment for a new wordpress site.
238258

@@ -252,3 +272,8 @@ Credits goes to:
252272
- [@buchdag](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/pull/226#event-1145800062)
253273
- [@fracz](https://github.com/fracz) - Many contributions!
254274

275+
276+
## Support on Beerpay
277+
Hey dude! Help me out for a couple of :beers:!
278+
279+
[![Beerpay](https://beerpay.io/evertramos/docker-compose-letsencrypt-nginx-proxy-companion/badge.svg?style=beer-square)](https://beerpay.io/evertramos/docker-compose-letsencrypt-nginx-proxy-companion) [![Beerpay](https://beerpay.io/evertramos/docker-compose-letsencrypt-nginx-proxy-companion/make-wish.svg?style=flat-square)](https://beerpay.io/evertramos/docker-compose-letsencrypt-nginx-proxy-companion?focus=wish)

.idea/$PRODUCT_WORKSPACE_FILE$

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/lets-encrypt.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conf.d/realip.conf

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#
1616
# The option 'set_real_ip_from'
1717
# must correspont to your docker network address
18-
set_real_ip_from 172.18.0.0/32;
19-
real_ip_header X-Real-IP;
20-
real_ip_recursive on;
18+
set_real_ip_from 172.16.0.0/12;
19+
set_real_ip_from 10.0.0.0/8;
20+
set_real_ip_from 192.168.0.0/16;
2121

2222
#
2323
# CloudFlare settings
@@ -26,25 +26,32 @@ real_ip_recursive on;
2626
# user's real IP to your app services you
2727
# must uncomment all lines below and be sure
2828
# to comment the lines of the "Basic settings"
29-
#set_real_ip_from 103.21.244.0/22;
30-
#set_real_ip_from 103.22.200.0/22;
31-
#set_real_ip_from 103.31.4.0/22;
32-
#set_real_ip_from 104.16.0.0/12;
33-
#set_real_ip_from 108.162.192.0/18;
34-
#set_real_ip_from 131.0.72.0/22;
35-
#set_real_ip_from 141.101.64.0/18;
36-
#set_real_ip_from 162.158.0.0/15;
37-
#set_real_ip_from 172.64.0.0/13;
38-
#set_real_ip_from 173.245.48.0/20;
39-
#set_real_ip_from 188.114.96.0/20;
40-
#set_real_ip_from 190.93.240.0/20;
41-
#set_real_ip_from 197.234.240.0/22;
42-
#set_real_ip_from 198.41.128.0/17;
43-
#set_real_ip_from 2400:cb00::/32;
44-
#set_real_ip_from 2606:4700::/32;
45-
#set_real_ip_from 2803:f800::/32;
46-
#set_real_ip_from 2405:b500::/32;
47-
#set_real_ip_from 2405:8100::/32;
48-
#set_real_ip_from 2c0f:f248::/32;
49-
#set_real_ip_from 2a06:98c0::/29;
50-
#real_ip_header X-Forwarded-For;
29+
set_real_ip_from 103.21.244.0/22;
30+
set_real_ip_from 103.22.200.0/22;
31+
set_real_ip_from 103.31.4.0/22;
32+
set_real_ip_from 104.16.0.0/12;
33+
set_real_ip_from 108.162.192.0/18;
34+
set_real_ip_from 131.0.72.0/22;
35+
set_real_ip_from 141.101.64.0/18;
36+
set_real_ip_from 162.158.0.0/15;
37+
set_real_ip_from 172.64.0.0/13;
38+
set_real_ip_from 173.245.48.0/20;
39+
set_real_ip_from 188.114.96.0/20;
40+
set_real_ip_from 190.93.240.0/20;
41+
set_real_ip_from 197.234.240.0/22;
42+
set_real_ip_from 198.41.128.0/17;
43+
set_real_ip_from 2400:cb00::/32;
44+
set_real_ip_from 2606:4700::/32;
45+
set_real_ip_from 2803:f800::/32;
46+
set_real_ip_from 2405:b500::/32;
47+
set_real_ip_from 2405:8100::/32;
48+
set_real_ip_from 2c0f:f248::/32;
49+
set_real_ip_from 2a06:98c0::/29;
50+
51+
#
52+
# Header for Real IP Address
53+
#
54+
real_ip_header X-Forwarded-For;
55+
#real_ip_header X-Real-IP;
56+
real_ip_recursive on;
57+

docker-compose-multiple-networks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
container_name: ${NGINX_WEB:-nginx-web}
88
restart: always
99
ports:
10-
- "${IP:-0.0.0.0}:80:80"
11-
- "${IP:-0.0.0.0}:443:443"
10+
- "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80"
11+
- "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
1212
volumes:
1313
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
1414
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
container_name: ${NGINX_WEB:-nginx-web}
88
restart: always
99
ports:
10-
- "${IP:-0.0.0.0}:80:80"
11-
- "${IP:-0.0.0.0}:443:443"
10+
- "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80"
11+
- "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
1212
volumes:
1313
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
1414
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d

docs/HOWTO-Synlogy.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Port mapping
2+
Synology default installs a web server on port 80 blocking certificate generation.
3+
4+
To circumvent this - if you do not need external access to the default web server (and you should not expose it anyway) configure your .env to use alternative ports and your router to forward the external official port to the alternative internal ports:
5+
6+
#
7+
# Set the local exposed ports for http and https - this will allow you to run with a legacy web
8+
# server already installed for local use
9+
#
10+
# NOTE: For this to function your internet router must forward the official ports to the mapped ports -
11+
# in this example external port 80 to docker host 81 and external port 443 to docker host 444
12+
#
13+
DOCKER_HTTP=81
14+
DOCKER_HTTPS=444
15+
16+
## File permissions
17+
To setup the needed configuration directoties and proper permissions run the below commands (assuming default ./data is where you have your catalog for persistent files)
18+
19+
mkdir -p data/certs
20+
mkdir data/htpasswd
21+
mkdir data/conf.d
22+
mkdir data/vhost.d
23+
mkdir data/html
24+
chgrp -R 101 data
25+
chmod -R g+rwx data
26+
27+
Contributed by https://github.com/nicolailang/

0 commit comments

Comments
 (0)