You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
&& sed -i'''s|^\s*include.*conf\.d/.*| include /etc/httpd-custom.d/*.conf;\n include /etc/httpd/conf.d/*.conf;\n include /etc/httpd/vhost.d/*.conf;\n|g' /etc/nginx/nginx.conf
68
+
&& sed -i'''s|^\s*include.*conf\.d/.*| include /etc/httpd-custom.d/*.conf;\n include /etc/httpd/conf.d/*.conf;\n include /etc/httpd/vhost.d/*.conf;\n|g' /etc/nginx/nginx.conf \
Copy file name to clipboardExpand all lines: README.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,12 +29,16 @@ Find me on **[Docker Hub](https://hub.docker.com/r/devilbox/nginx-mainline)**:
29
29
30
30
1. Automated virtual hosts can be enabled by providing `-e MASS_VHOST_ENABLE=1`.
31
31
2. You should mount a local project directory into the Docker under `/shared/httpd` (`-v /local/path:/shared/httpd`).
32
-
3. You can optionally specify a global server name suffix via e.g.: `-e MASS_VHOST_TLD=.local`
32
+
3. You can optionally specify a global server name suffix via e.g.: `-e MASS_VHOST_TLD=.loc`
33
33
4. You can optionally specify a global subdirectory from which the virtual host will servve the documents via e.g.: `-e MASS_VHOST_DOCROOT=www`
34
-
4. Allow the Docker to expose its port via `-p 80:80`.
35
-
5. Have DNS names point to the IP address the docker runs on (e.g. via `/etc/hosts`)
34
+
5. Allow the Docker to expose its port via `-p 80:80`.
35
+
6. Have DNS names point to the IP address the container runs on (e.g. via `/etc/hosts`)
36
36
37
-
With the above described settings, whenever you create a local directory under your projects dir, such as `/local/path/mydir`, there will be a new virtual host created by the same name `http://mydir`. You can also specify a global suffix for the vhost names via `-e MASS_VHOST_TLD=.local`, afterwards your above created vhost would be reachable via `http://mydir.local`.
37
+
With the above described settings, whenever you create a local directory under your projects dir
38
+
such as `/local/path/mydir`, there will be a new virtual host created by the same name
39
+
`http://mydir`. You can also specify a global suffix for the vhost names via
40
+
`-e MASS_VHOST_TLD=.loc`, afterwards your above created vhost would be reachable via
41
+
`http://mydir.loc`.
38
42
39
43
Just to give you a few examples:
40
44
@@ -67,7 +71,7 @@ docker run -it \
67
71
-p 80:80 \
68
72
-e MASS_VHOST_ENABLE=1 \
69
73
-e MASS_VHOST_DOCROOT=www \
70
-
-e MASS_VHOST_TLD=.local \
74
+
-e MASS_VHOST_TLD=.loc \
71
75
-v /local/path:/shared/httpd \
72
76
devilbox/nginx-mainline
73
77
```
@@ -99,7 +103,7 @@ PHP-FPM is not included inside this Docker container, but can be enabled to cont
99
103
100
104
#### Disabling the default virtual host
101
105
102
-
If you only want to server you custom projects and don't need the default virtual host, you can disable it by `-e MAIN_VHOST_DISABLE=1`.
106
+
If you only want to server you custom projects and don't need the default virtual host, you can disable it by `-e MAIN_VHOST_ENABLE=0`.
103
107
104
108
105
109
## Options
@@ -130,7 +134,10 @@ This Docker container adds a lot of injectables in order to customize it to your
130
134
131
135
| Variable | Type | Default | Description |
132
136
|----------|------|---------|-------------|
133
-
| MAIN_VHOST_DISABLE | bool |`0`| By default there is a standard (catch-all) vhost configured to accept requests served from `/var/www/default/htdocs`. If you want to disable it, set the value to `1`.<br/><strong>Note:</strong>The `htdocs` dir name can be changed with `MAIN_VHOST_DOCROOT`. See below. |
137
+
| MAIN_VHOST_ENABLE | bool |`1`| By default there is a standard (catch-all) vhost configured to accept requests served from `/var/www/default/htdocs`. If you want to disable it, set the value to `0`.<br/><strong>Note:</strong>The `htdocs` dir name can be changed with `MAIN_VHOST_DOCROOT`. See below. |
138
+
| MAIN_VHOST_SSL_TYPE | string |`plain`| <ul><li><code>plain</code> - only serve via http</li><li><code>ssl</code> - only serve via https</li><li><code>both</code> - serve via http and https</li><li><code>redir</code> - serve via https and redirect http to https</li></ul> |
139
+
| MAIN_VHOST_SSL_GEN | bool |`0`|`0`: Do not generate an ssl certificate<br/> `1`: Generate self-signed certificate automatically |
140
+
| MAIN_VHOST_SSL_CN | string |`localhost`| Comma separated list of CN names for SSL certificate generation (The domain names by which you want to reach the default server) |
134
141
| MAIN_VHOST_DOCROOT | string |`htdocs`| This is the directory name appended to `/var/www/default/` from which the default virtual host will serve its files.<br/><strong>Default:</strong><br/>`/var/www/default/htdocs`<br/><strong>Example:</strong><br/>`MAIN_VHOST_DOCROOT=www`<br/>Doc root: `/var/www/default/www`|
135
142
| MAIN_VHOST_TPL | string |`cfg`| Directory within th default vhost base path (`/var/www/default`) to look for templates to overwrite virtual host settings. See [vhost-gen](https://github.com/devilbox/vhost-gen/tree/master/etc/templates) for available template files.<br/><strong>Resulting default path:</strong><br/>`/var/www/default/cfg`|
136
143
| MAIN_VHOST_STATUS_ENABLE | bool |`0`| Enable httpd status page. |
@@ -141,7 +148,9 @@ This Docker container adds a lot of injectables in order to customize it to your
141
148
| Variable | Type | Default | Description |
142
149
|----------|------|---------|-------------|
143
150
| MASS_VHOST_ENABLE | bool |`0`| You can enable mass virtual hosts by setting this value to `1`. Mass virtual hosts will be created for each directory present in `/shared/httpd` by the same name including a top-level domain suffix (which could also be a domain+tld). See `MASS_VHOST_TLD` for how to set it. |
144
-
| MASS_VHOST_TLD | string |`.local`| This string will be appended to the server name (which is built by its directory name) for mass virtual hosts and together build the final domain.<br/><strong>Default:</strong>`<project>.local`<br/><strong>Example:</strong><br/>Path: `/shared/httpd/temp`<br/>`MASS_VHOST_TLD=.lan`<br/>Server name: `temp.lan`<br/><strong>Example:</strong><br/>Path:`/shared/httpd/api`<br/>`MASS_VHOST_TLD=.example.com`<br/>Server name: `api.example.com`|
151
+
| MASS_VHOST_SSL_TYPE | string |`plain`| <ul><li><code>plain</code> - only serve via http</li><li><code>ssl</code> - only serve via https</li><li><code>both</code> - serve via http and https</li><li><code>redir</code> - serve via https and redirect http to https</li></ul> |
152
+
| MASS_VHOST_SSL_GEN | bool |`0`|`0`: Do not generate an ssl certificate<br/> `1`: Generate self-signed certificate automatically |
153
+
| MASS_VHOST_TLD | string |`.loc`| This string will be appended to the server name (which is built by its directory name) for mass virtual hosts and together build the final domain.<br/><strong>Default:</strong>`<project>.loc`<br/><strong>Example:</strong><br/>Path: `/shared/httpd/temp`<br/>`MASS_VHOST_TLD=.lan`<br/>Server name: `temp.lan`<br/><strong>Example:</strong><br/>Path:`/shared/httpd/api`<br/>`MASS_VHOST_TLD=.example.com`<br/>Server name: `api.example.com`|
145
154
| MASS_VHOST_DOCROOT | string |`htdocs`| This is a subdirectory within your project dir under each project from which the web server will serve its files.<br/>`/shared/httpd/<project>/$MASS_VHOST_DOCROOT/`<br/><strong>Default:</strong><br/>`/shared/httpd/<project>/htdocs/`|
146
155
| MASS_VHOST_TPL | string |`cfg`| Directory within your new virtual host to look for templates to overwrite virtual host settings. See [vhost-gen](https://github.com/devilbox/vhost-gen/tree/master/etc/templates) for available template files.<br/>`/shared/httpd/<project>/$MASS_VHOST_TPL/`<br/><strong>Resulting default path:</strong><br/>`/shared/httpd/<project>/cfg/`|
147
156
@@ -159,7 +168,8 @@ This Docker container adds a lot of injectables in order to customize it to your
159
168
160
169
| Docker | Description |
161
170
|--------|-------------|
162
-
| 80 | Nginx listening Port |
171
+
| 80 | HTTP listening Port |
172
+
| 443 | HTTPS listening Port |
163
173
164
174
165
175
## Examples
@@ -247,8 +257,5 @@ It allows any of the following combinations:
0 commit comments