Added role nginx/mail_proxy

wip
Felix Stupp 5 years ago
parent fad1abc638
commit 88afbf7106
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -0,0 +1,6 @@
---
domain: "example.com"
# port: 12345
# backend: "127.0.0.1:12345"
# protocol: smtp / imap / pop3

@ -0,0 +1,6 @@
---
dependencies:
- role: acme/certificate
domain: "{{ domain }}"
- role: nginx/application

@ -0,0 +1,15 @@
---
- name: Configure proxy for {{ protocol }} on {{ domain }}:{{ port }}
template:
src: mail_proxy.conf
dest: "{{ nginx_streams_directory }}/{{ domain }}:{{ port }}"
owner: "{{ nginx_system_user }}"
group: "{{ nginx_system_user }}"
mode: "u=rw,g=r,o=r"
- name: Allow {{ protocol }} in firewall
ufw:
rule: allow
port: "{{ port }}"
proto: tcp

@ -0,0 +1,16 @@
server {
listen {{ port }};
protocol {{ protocol }};
proxy_pass {{ backend }};
server_name {{ domain }};
proxy_pass_error_message on;
starttls on;
ssl_certificate {{ acme_certificate_location }};
ssl_certificate_key {{ acme_key_location }};
{{ nginx_ssl_configuration }}
}
Loading…
Cancel
Save