From ca0b1d7730f2e1829ea8fe0ba2078115ffb5fd92 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Thu, 16 Jan 2020 18:08:19 -0500 Subject: [PATCH] fix nginx config for single-page app --- automation/roles/nginx/templates/site_node.conf.j2 | 5 ++++- automation/roles/nginx/templates/site_node_alias.conf.j2 | 5 ++++- automation/roles/nginx/templates/site_sage.conf.j2 | 5 ++++- automation/roles/nginx/templates/site_sage_alias.conf.j2 | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/automation/roles/nginx/templates/site_node.conf.j2 b/automation/roles/nginx/templates/site_node.conf.j2 index fabd565d..93444de3 100644 --- a/automation/roles/nginx/templates/site_node.conf.j2 +++ b/automation/roles/nginx/templates/site_node.conf.j2 @@ -2,8 +2,11 @@ server { server_name {{ server_name }}; listen {{ ssl_port }} ssl http2; + root /home/bubble/site/; + index index.html; + location / { - root /home/bubble/site/; + try_files $uri /index.html =404; } location /api { diff --git a/automation/roles/nginx/templates/site_node_alias.conf.j2 b/automation/roles/nginx/templates/site_node_alias.conf.j2 index 546a62bd..906c005d 100644 --- a/automation/roles/nginx/templates/site_node_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_node_alias.conf.j2 @@ -2,8 +2,11 @@ server { server_name {{ server_alias }}; listen {{ ssl_port }} ssl http2; + root /home/bubble/site/; + index index.html; + location / { - root /home/bubble/site/; + try_files $uri /index.html =404; } location /api { diff --git a/automation/roles/nginx/templates/site_sage.conf.j2 b/automation/roles/nginx/templates/site_sage.conf.j2 index dcb5fad7..8bf9b517 100644 --- a/automation/roles/nginx/templates/site_sage.conf.j2 +++ b/automation/roles/nginx/templates/site_sage.conf.j2 @@ -2,8 +2,11 @@ server { listen 80; server_name {{ server_name }}; + root /home/bubble/site/; + index index.html; + location / { - root /home/bubble/site/; + try_files $uri /index.html =404; } location /api { diff --git a/automation/roles/nginx/templates/site_sage_alias.conf.j2 b/automation/roles/nginx/templates/site_sage_alias.conf.j2 index 0c677195..ed27db2d 100644 --- a/automation/roles/nginx/templates/site_sage_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_sage_alias.conf.j2 @@ -2,8 +2,11 @@ server { listen 80; server_name {{ server_alias }}; + root /home/bubble/site/; + index index.html; + location / { - root /home/bubble/site/; + try_files $uri /index.html =404; } location /api {