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
@@ -10,25 +10,45 @@ This role is currently in alpha testing
10
10
11
11
Ansible 2.4
12
12
13
-
## Role Variables
13
+
-------
14
14
15
-
Base role variables are defined in `default/main.yml` and is divied in to blocks base on the conf file or vhost configureation.
15
+
## Configuration
16
16
17
-
The Role Options section is for configureing option for how the role function and which task to run.
17
+
All options in this section are configured as defaults for Nginx and are defined in `defaults.yml` so that they can easly be overwritten within the playbook.
18
+
19
+
### Self Signed Cert Generation
20
+
21
+
The Role has an option for generating a self signed TLS cert for testing. This setting is set to false defaultly to prevent unwanted self signed cert generation.
18
22
19
23
```yaml
20
24
selfsigned_cert: false # Generate self signed SSL cert.
21
25
```
22
26
23
-
The role creates three config file at the moment `nginx.conf, general.conf, and a vhost conf`.
27
+
### Configuratoin Files
28
+
29
+
All options in this section are configured as defaults for Nginx and are defind in `defaults.yml` so that they can easly be overwritten within the playbook.
30
+
31
+
This role currently creates three conf files.
24
32
25
-
Configs are defined in `defaults/main.yml so they can be easily overwritten elsewhere in the playbook.
33
+
* nginx.conf
34
+
* general.conf
35
+
* server.conf (vhost)
26
36
27
-
Example of modifing Nginx configureation:
37
+
#### nginx.conf
28
38
29
-
Lets take a look at the smaple configs found in `defaults/main.yml` that are found in the `nginx.conf` section.
39
+
This file contains options for cofiguring global options pretaining to the Nginx service.
The recommended way to change default value of varibles for `nginx.conf` and `general.conf` is to copy the vars that need to be changed to `vars/main.yml`. It is best to also leave a comment noting the conf file the variable relates to and which stanza the config is stored in. This allows for easy versioning of custom vars in you own repo.
94
+
#### general.conf
43
95
44
-
```yaml
45
-
# nginx.conf
96
+
This conf file is used to set security headers, restrict access to `.` files, and compression options.
Note: Configuring variable like this allows for easy versioning of custom vars in your own repo/vc system.
54
-
```
127
+
`**NOTE:** This file is likely to be deprecated in future when I have time to rewrite the conf file tasks.`
55
128
56
-
## VHosts
129
+
#### server.conf
57
130
58
-
This role uses the template `templates/server.conf.j2` to create virtualhost conf files for applications.
131
+
This file is used to configure Nginx to actually server the web application. This role generates these files from a template in the task `tasks/configure.yml`.
59
132
60
-
First create a new `.yml` file in `vars` named after the application ex. `someapp.yml`
61
-
Second copy the vars from the vhosts section in `defaults/main.yml` the file you created and then fill in the vars to configure the vhost.
62
-
Any config not need can be remove. ex. The `fastcgi_php` configs can be deleted if they are not need as long proper YAML indentaion is maintained.
133
+
Currently the options below are required for Nginx to be able to run the app
The SSL configs can be uncommented and set to the location of any certificates that have been uploaded or generated for the application to enable HTTPS.
92
-
93
-
The `security_headers` are set globally in `general.conf` and can be modified here.
94
-
95
-
`Fastcgi_php`can be uncommented for php apps that utilize fastcgi. Please note that this role currently only supports `php7.0-fpm`.
96
-
97
-
## Dependencies
98
-
99
-
Currently there are no plans for this role to have any dependencies of other roles.
100
-
101
165
## Example Playbook
102
166
103
167
Including an example of how to use your role (for instance, with variables
@@ -109,24 +173,24 @@ passed in as parameters) is always nice for users too:
0 commit comments