@@ -30,11 +30,13 @@ Collection of Nginx configs for most popular CMS/CMF/Frameworks based on PHP.
30
30
Docker image, but I haven't checked it properly yet, their configs require addition nginx modules and setup
31
31
and it can't be just copied to the usual nginx setup. However, you can use it with docker.
32
32
Also I don't agree with nginx microcache for every site, see known traps.
33
+ - [ hub.docker.com/_ /nginx] ( https://hub.docker.com/_/nginx/ )
34
+ Official nginx docker image and docs.
33
35
34
36
So here I'm trying to put together all (my) good patterns and knowledge, and organize it as simply as possible in comparison with complex examples above. So anyone will be able to copy this configs and get a good nginx setup out of the box :)
35
37
36
38
Time track:
37
- - [ Filipp Frizzy] ( https://github.com/Friz-zy/ ) 42.41h
39
+ - [ Filipp Frizzy] ( https://github.com/Friz-zy/ ) 45.56h
38
40
39
41
### Support
40
42
@@ -92,6 +94,9 @@ Template of common site configuration
92
94
* ` static_location.conf `
93
95
Include with location for static files
94
96
97
+ # Dockerfile
98
+ ` Dockerfile ` example with build args, configs copying and custom envsubst template engine
99
+
95
100
#### Docker-compose
96
101
` docker-compose.yml ` example for nginx
97
102
@@ -265,6 +270,13 @@ Then valid user after visit to the their site will be automatically blocked on y
265
270
You can fight with this practice using ` http_referer ` , see ` snippets/referer.conf.j2 ` template ;)
266
271
Warning: I have not tested this code yet
267
272
273
+ #### Default templating engine in official docker image can't proceed variables with default values like ` ${var:-$DEFAULT} `
274
+
275
+ By default nginx in docker use [ GNU envsubst] ( https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html )
276
+ that [ can't proceed variables with default values] ( https://stackoverflow.com/questions/50230361/envsubst-default-values-for-unset-variables ) .
277
+ You can use instead [ a8m envsubst] ( https://github.com/a8m/envsubst ) or [ stephenc envsub] ( https://github.com/stephenc/envsub ) ,
278
+ first one already has a prebuilded binary for x86_64 arch, check the ` Dockerfile ` in this repo ;)
279
+
268
280
#### Includes like ` <dir>/*.conf ` are processed in the alphabetic order
269
281
270
282
This is important for nginx in docker as all configs are located in one dir
0 commit comments