From 91dddb20f89942aff21642d534385514428386b4 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 28 Jan 2024 19:24:00 +0100 Subject: [PATCH] Add Host header and replace . with \. --- roles/apps/templates/nginx/conf.d/ipfs.conf.j2 | 3 ++- roles/apps/templates/nginx/conf.d/monerod.conf.j2 | 1 + roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 b/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 index b76ecba..c7c012a 100644 --- a/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 @@ -17,7 +17,7 @@ server { server { listen 8080; - server_name ~^([\w-]+\.(ipfs|ipns)\.)?{{ apps_vars.ipfs.gateway_domain }}$; + server_name ~^([\w-]+\.(ipfs|ipns)\.)?{{ apps_vars.ipfs.gateway_domain | replace('.', '\.') }}$; location / { set $upstream http://ipfs:8080; @@ -26,5 +26,6 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto "https"; proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; } } diff --git a/roles/apps/templates/nginx/conf.d/monerod.conf.j2 b/roles/apps/templates/nginx/conf.d/monerod.conf.j2 index 9db7b46..182e8da 100644 --- a/roles/apps/templates/nginx/conf.d/monerod.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/monerod.conf.j2 @@ -12,5 +12,6 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto "https"; proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; } } diff --git a/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 b/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 index 2cc7c07..68884b6 100644 --- a/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 @@ -12,6 +12,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto "https"; proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; # WebSocket support proxy_http_version 1.1;