diff options
Diffstat (limited to 'roles/install_nginx')
-rw-r--r-- | roles/install_nginx/files/nginx.conf | 29 | ||||
-rw-r--r-- | roles/install_nginx/tasks/main.yml | 26 |
2 files changed, 55 insertions, 0 deletions
diff --git a/roles/install_nginx/files/nginx.conf b/roles/install_nginx/files/nginx.conf new file mode 100644 index 0000000..c27e4c1 --- /dev/null +++ b/roles/install_nginx/files/nginx.conf @@ -0,0 +1,29 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + + access_log off; + error_log /var/log/nginx/error.log; + + #gzip on; + gzip off; + gzip_disable "msie6"; + + charset UTF-8; + + # Virtual Host Config + include /etc/nginx/conf.d/*.conf; + include /etc/nginx/sites-enabled/*; +} diff --git a/roles/install_nginx/tasks/main.yml b/roles/install_nginx/tasks/main.yml new file mode 100644 index 0000000..5b8fe65 --- /dev/null +++ b/roles/install_nginx/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- name: install nginx + pacman: + name: nginx + state: present + +- name: copy nginx.conf + copy: + src: nginx.conf + dest: /etc/nginx/nginx.conf + +- name: add sites-available folder + file: + path: /etc/nginx/sites-available + state: directory + +- name: add sites-enabled folder + file: + path: /etc/nginx/sites-enabled + state: directory + +- name: start and enable nginx + systemd: + name: nginx.service + enabled: yes + state: started |