Added role nginx/forward
parent
08ebc2f5cb
commit
c2bd392675
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
domain: example.com
|
||||||
|
destination: example.com
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- role: acme/certificate
|
||||||
|
domain: "{{ domain }}"
|
||||||
|
- role: nginx/application
|
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Enable forwarding {{ domain }} to {{ destination }}
|
||||||
|
template:
|
||||||
|
src: forwarding.conf
|
||||||
|
dest: "{{ nginx_sites_directory }}/{{ domain }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "u=rw,g=r,o=r"
|
||||||
|
notify: reload nginx
|
@ -0,0 +1,13 @@
|
|||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
server_name {{ domain }};
|
||||||
|
|
||||||
|
ssl on;
|
||||||
|
ssl_certificate {{ acme_certificate_location }};
|
||||||
|
ssl_certificate_key {{ acme_key_location }};
|
||||||
|
|
||||||
|
{{ nginx_https_configuration }}
|
||||||
|
|
||||||
|
redirect 301 https://{{ destination }}$request_uri;
|
||||||
|
}
|
Loading…
Reference in New Issue