From 0afb8150e399d8fd1730ef63e232f5830b30e4db Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 18 Jan 2020 15:37:35 -0500 Subject: [PATCH] proper mapping of single-page app files to web root --- automation/roles/nginx/templates/site_node.conf.j2 | 1 + automation/roles/nginx/templates/site_node_alias.conf.j2 | 1 + automation/roles/nginx/templates/site_sage.conf.j2 | 1 + automation/roles/nginx/templates/site_sage_alias.conf.j2 | 1 + 4 files changed, 4 insertions(+) diff --git a/automation/roles/nginx/templates/site_node.conf.j2 b/automation/roles/nginx/templates/site_node.conf.j2 index 93444de3..7ae476d2 100644 --- a/automation/roles/nginx/templates/site_node.conf.j2 +++ b/automation/roles/nginx/templates/site_node.conf.j2 @@ -6,6 +6,7 @@ server { index index.html; location / { + rewrite ^/(\w+/)+(?.*)$ /$basename break; try_files $uri /index.html =404; } diff --git a/automation/roles/nginx/templates/site_node_alias.conf.j2 b/automation/roles/nginx/templates/site_node_alias.conf.j2 index 906c005d..9a0e0c61 100644 --- a/automation/roles/nginx/templates/site_node_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_node_alias.conf.j2 @@ -6,6 +6,7 @@ server { index index.html; location / { + rewrite ^/(\w+/)+(?.*)$ /$basename break; try_files $uri /index.html =404; } diff --git a/automation/roles/nginx/templates/site_sage.conf.j2 b/automation/roles/nginx/templates/site_sage.conf.j2 index 8bf9b517..04ebe4f5 100644 --- a/automation/roles/nginx/templates/site_sage.conf.j2 +++ b/automation/roles/nginx/templates/site_sage.conf.j2 @@ -6,6 +6,7 @@ server { index index.html; location / { + rewrite ^/(\w+/)+(?.*)$ /$basename break; try_files $uri /index.html =404; } diff --git a/automation/roles/nginx/templates/site_sage_alias.conf.j2 b/automation/roles/nginx/templates/site_sage_alias.conf.j2 index ed27db2d..140d2a7f 100644 --- a/automation/roles/nginx/templates/site_sage_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_sage_alias.conf.j2 @@ -6,6 +6,7 @@ server { index index.html; location / { + rewrite ^/(\w+/)+(?.*)$ /$basename break; try_files $uri /index.html =404; }