From 5fa82b06255ad4fb93528de9965ff1e8eff09c51 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Mon, 6 Jul 2020 11:04:07 +0000 Subject: [PATCH] chore: Fixes nginx routing for the design-system app. --- .deployment/barista/Jenkinsfile | 2 +- .../nginx/sites-available/barista-internal.conf | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.deployment/barista/Jenkinsfile b/.deployment/barista/Jenkinsfile index e58c51b514..b20db5dff8 100644 --- a/.deployment/barista/Jenkinsfile +++ b/.deployment/barista/Jenkinsfile @@ -147,7 +147,7 @@ pipeline { # Build next section of the design system node \ --max_old_space_size=8192 \ - ./node_modules/.bin/ng run next:build:production-internal + ./node_modules/.bin/ng run next:build:production-internal --base-href='/next/' fi cat dist/barista-data/routes.txt diff --git a/.deployment/barista/nginx/sites-available/barista-internal.conf b/.deployment/barista/nginx/sites-available/barista-internal.conf index e0b70aabc4..0c1ba9f76e 100644 --- a/.deployment/barista/nginx/sites-available/barista-internal.conf +++ b/.deployment/barista/nginx/sites-available/barista-internal.conf @@ -5,7 +5,6 @@ server { server_name localhost; index index.html; - root /var/www/barista; # security headers add_header X-Frame-Options "SAMEORIGIN" always; @@ -19,12 +18,15 @@ server { deny all; } - # location /next { - # root /var/www/next; - # try_files $uri $uri/ /index.html; - # } + location ~ ^/next(/)? { + root /var/www/next/; + # https://stackoverflow.com/a/41629576 + rewrite ^/next/(.*) /$1 break; + try_files $uri /next/index.html; + } - location / { + location ~ / { + root /var/www/barista; try_files $uri $uri/ /index.html; }