role service-nginx: add new config snippets gzip.conf and redirect-to-ssl.conf

This commit is contained in:
Julian Labus 2018-09-11 14:03:26 +02:00
parent cfa648219b
commit 07ab6837fe
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
3 changed files with 21 additions and 2 deletions

View file

@ -0,0 +1,3 @@
gzip on;
gzip_types text/css text/plain text/html text/javascript text/xml application/javascript application/xml application/json;
gzip_min_length 1000;

View file

@ -0,0 +1 @@
return 301 https://$server_name$request_uri;

View file

@ -84,14 +84,29 @@
- name: sync ssl certs - name: sync ssl certs
shell: /etc/cron.daily/ssl_certs shell: /etc/cron.daily/ssl_certs
- name: write nginx configuration letsencrypt-acme-challenge.conf - name: copy gzip.conf to snippets
copy:
src: gzip.conf
dest: /etc/nginx/snippets/gzip.conf
mode: 0644
owner: root
group: root
- name: copy redirect-to-ssl.conf to snippets
copy:
src: redirect-to-ssl.conf
dest: /etc/nginx/snippets/redirect-to-ssl.conf
mode: 0644
owner: root
group: root
- name: write letsencrypt-acme-challenge.conf to snippets
template: template:
src: letsencrypt-acme-challenge.conf.j2 src: letsencrypt-acme-challenge.conf.j2
dest: /etc/nginx/snippets/letsencrypt-acme-challenge.conf dest: /etc/nginx/snippets/letsencrypt-acme-challenge.conf
mode: 0644 mode: 0644
owner: root owner: root
group: root group: root
notify: restart nginx
- name: write nginx configuration nginx.conf - name: write nginx configuration nginx.conf
template: template: