role service-nginx: add new config snippets gzip.conf and redirect-to-ssl.conf
This commit is contained in:
parent
cfa648219b
commit
07ab6837fe
3 changed files with 21 additions and 2 deletions
3
roles/service-nginx/files/gzip.conf
Normal file
3
roles/service-nginx/files/gzip.conf
Normal 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;
|
1
roles/service-nginx/files/redirect-to-ssl.conf
Normal file
1
roles/service-nginx/files/redirect-to-ssl.conf
Normal file
|
@ -0,0 +1 @@
|
|||
return 301 https://$server_name$request_uri;
|
|
@ -84,14 +84,29 @@
|
|||
- name: sync 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:
|
||||
src: letsencrypt-acme-challenge.conf.j2
|
||||
dest: /etc/nginx/snippets/letsencrypt-acme-challenge.conf
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
notify: restart nginx
|
||||
|
||||
- name: write nginx configuration nginx.conf
|
||||
template:
|
||||
|
|
Loading…
Reference in a new issue