From c5365a53014df6e6dd4e183e5990e453cfd42f58 Mon Sep 17 00:00:00 2001 From: Bas Meijer Date: Thu, 21 Dec 2023 11:21:34 +0100 Subject: [PATCH] Amend server name to create a repo variable in Nginx config. --- .../artifactory_nginx_ssl/templates/artifactory.conf.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/templates/artifactory.conf.j2 b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/templates/artifactory.conf.j2 index 4d3976ee..5a0e189f 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/templates/artifactory.conf.j2 +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/templates/artifactory.conf.j2 @@ -18,7 +18,11 @@ ## server configuration server { listen 443 ssl http2; +{% if artifactory_docker_registry_subdomain %} + server_name ~(?.+)\.{{ server_name }}; +{% else %} server_name {{ server_name }}; +{% endif %} if ($http_x_forwarded_proto = '') { set $http_x_forwarded_proto $scheme; } @@ -47,4 +51,4 @@ proxy_pass http://artifactory-direct; } } -} \ No newline at end of file +}