-
Notifications
You must be signed in to change notification settings - Fork 10
/
2-deploy-nginx-web-server.yml
55 lines (54 loc) · 2.16 KB
/
2-deploy-nginx-web-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: Deploy an NGINX Plus web server
hosts: aws_ec2
become: true
remote_user: "{{ hostvars[inventory_hostname]['tags']['user'] }}"
roles:
- role: nginxinc.nginx_config
vars:
nginx_config_http_template_enable: true
nginx_config_http_template:
- template_file: http/default.conf.j2
deployment_location: /etc/nginx/conf.d/default.conf
config:
servers:
- core:
listen:
- port: 80
server_name: localhost
log:
access:
- path: /var/log/nginx/access.log
format: main
sub_filter:
sub_filters:
- string: server_hostname
replacement: $hostname
- string: server_address
replacement: $server_addr:$server_port
- string: server_url
replacement: $request_uri
- string: remote_addr
replacement: '$remote_addr:$remote_port'
- string: server_date
replacement: $time_local
- string: client_browser
replacement: $http_user_agent
- string: request_id
replacement: $request_id
- string: nginx_version
replacement: $nginx_version
- string: document_root
replacement: $document_root
- string: proxied_for_ip
replacement: $http_x_forwarded_for
locations:
- location: /
core:
index: index.html
root: /usr/share/nginx/html
nginx_config_html_demo_template_enable: true
nginx_config_html_demo_template:
- template_file: www/index.html.j2
deployment_location: /usr/share/nginx/html/index.html
web_server_name: Ansible NGINX collection