summaryrefslogtreecommitdiffstats
path: root/roles/znc/templates/znc_nginx.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/znc/templates/znc_nginx.conf.j2')
-rw-r--r--roles/znc/templates/znc_nginx.conf.j230
1 files changed, 30 insertions, 0 deletions
diff --git a/roles/znc/templates/znc_nginx.conf.j2 b/roles/znc/templates/znc_nginx.conf.j2
new file mode 100644
index 0000000..b11e6e3
--- /dev/null
+++ b/roles/znc/templates/znc_nginx.conf.j2
@@ -0,0 +1,30 @@
+# {{ ansible_managed }}
+
+server {
+ listen 80;
+ listen [::]:80;
+ server_name {{ znc_subdomain }};
+
+ include snippets/letsencrypt.conf;
+
+ location / {
+ return 301 https://$host$request_uri;
+ }
+}
+
+server {
+ listen 443 ssl http2;
+ listen [::]:443 ssl http2;
+ server_name {{ znc_subdomain }};
+
+ ssl_certificate /etc/letsencrypt/live/{{ znc_subdomain }}/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/{{ znc_subdomain }}/privkey.pem;
+ ssl_trusted_certificate /etc/letsencrypt/live/{{ znc_subdomain }}/chain.pem;
+
+ location / {
+ proxy_pass http://localhost:7778;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ }
+}