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
Copy file name to clipboardExpand all lines: README.md
+20-40Lines changed: 20 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ An example of a fully-populated nginx_vhosts entry, using a `|` to declare a blo
54
54
55
55
Please take note of the indentation in the above block. The first line should be a normal 2-space indent. All other lines should be indented normally relative to that line. In the generated file, the entire block will be 4-space indented. This style will ensure the config file is indented correctly.
56
56
57
+
57
58
- listen: "80"
58
59
server_name: "example.com www.example.com"
59
60
return: "301 https://example.com$request_uri"
@@ -63,6 +64,25 @@ An example of a secondary vhost which will redirect to the one shown above.
63
64
64
65
*Note: The `filename` defaults to the first domain in `server_name`, if you have two vhosts with the same domain, eg. a redirect, you need to manually set the `filename` so the second one doesn't override the first one*
65
66
67
+
nginx_vhosts_stream: []
68
+
69
+
Define stream server entries here. The formatting is comparable with `nginx_vhosts`.
An example of a fully-populated nginx_vhosts_stream entry. The formatting is comparable with `nginx_vhosts`.
82
+
**NOTE**: Ensure that the stream module is loaded. Enabling this differs per distibution, but should look like
83
+
`load_module modules/ngx_stream_module.so;` (defined via e.g. `nginx_extra_conf_options`). On some distributions
84
+
(e.g. RedHat based ones), the stream module is enabled automatically.
85
+
66
86
nginx_remove_default_vhost: false
67
87
68
88
Whether to remove the 'default' virtualhost configuration supplied by Nginx. Useful if you want the base `/` URL to be directed at one of your own virtual hosts configured in a separate .conf file.
@@ -231,46 +251,6 @@ Create the child template in the path you configured above and extend `geerlingg
231
251
{% endblock %}
232
252
```
233
253
234
-
### Example: LDAP stream via Nginx
235
-
236
-
This example describes how to setup a secure LDAP stream via Nginx.
237
-
238
-
Create the following file in your playbook directory (e.g. `templates/nginx/vhost-stream.j2`):
239
-
240
-
```
241
-
server {
242
-
listen {{ item.listen }};
243
-
244
-
{% if item.server_name is defined and item.server_name|length > 0 %}
245
-
server_name {{ item.server_name }};
246
-
{% endif %}
247
-
248
-
{% if item.vhost_parameters is defined %}
249
-
{{ item.vhost_parameters|indent(8) }}
250
-
{% endif %}
251
-
252
-
}
253
-
```
254
-
255
-
Then, in your Ansible vars, specify e.g. the following configuration:
0 commit comments