From 8175a62c0b932db8ce62de0c9d942110c9ffcb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 21 Jun 2021 11:28:36 +0200 Subject: [PATCH] nginx: make sure https redirect works --- roles/authelia/templates/authelia.conf.j2 | 4 ++-- roles/jellyfin/templates/jellyfin.conf.j2 | 3 ++- roles/keycloak/templates/keycloak.conf.j2 | 5 +++-- roles/portainer/templates/portainer.conf.j2 | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/roles/authelia/templates/authelia.conf.j2 b/roles/authelia/templates/authelia.conf.j2 index 73e2ddc..7495132 100644 --- a/roles/authelia/templates/authelia.conf.j2 +++ b/roles/authelia/templates/authelia.conf.j2 @@ -1,7 +1,7 @@ server { - listen 80; server_name auth.{{ base_domain }}; - return 301 https://$host$request_uri; + listen 80; + return 301 https://$server_name$request_uri; } server { diff --git a/roles/jellyfin/templates/jellyfin.conf.j2 b/roles/jellyfin/templates/jellyfin.conf.j2 index 66960f9..b247502 100644 --- a/roles/jellyfin/templates/jellyfin.conf.j2 +++ b/roles/jellyfin/templates/jellyfin.conf.j2 @@ -1,6 +1,7 @@ server { + server_name "jellyfin.{{ base_domain }}"; listen 80; - return 301 https://$host$request_uri; + return 301 https://$server_name$request_uri; } server { diff --git a/roles/keycloak/templates/keycloak.conf.j2 b/roles/keycloak/templates/keycloak.conf.j2 index 6bb5776..c2e3fdf 100644 --- a/roles/keycloak/templates/keycloak.conf.j2 +++ b/roles/keycloak/templates/keycloak.conf.j2 @@ -1,6 +1,7 @@ server { - listen 80; - return 301 https://$host$request_uri; + server_name "keycloak.{{ base_domain }}"; + listen 80; + return 301 https://$server_name$request_uri; } server { diff --git a/roles/portainer/templates/portainer.conf.j2 b/roles/portainer/templates/portainer.conf.j2 index c61a7fe..4dd854f 100644 --- a/roles/portainer/templates/portainer.conf.j2 +++ b/roles/portainer/templates/portainer.conf.j2 @@ -1,7 +1,7 @@ server { - listen 80; server_name portainer.{{ base_domain }}; - return 301 https://$host$request_uri; + listen 80; + return 301 https://$server_name$request_uri; } server {