diff --git a/packages/react-components/nginx.storybook.conf b/packages/react-components/nginx.storybook.conf index 57d48d2b..bfa5d7ab 100644 --- a/packages/react-components/nginx.storybook.conf +++ b/packages/react-components/nginx.storybook.conf @@ -26,9 +26,24 @@ http { error_log /tmp/error.log; access_log /tmp/access.log; - location / { - root /usr/share/nginx/html; - try_files $uri /index.html; + # Redirect requests for root to gov.bc.ca B.C. Design System landing page + # Perma-link: https://www2.gov.bc.ca/gov/content?id=67906B3698E44F4592AD4C6DC375B8F1 + location = / { + return 301 https://gov.bc.ca/designsystem; } + + # Requests within /react-components/ path get served the Storybook app + location /react-components/ { + alias /usr/share/nginx/html/; + try_files $uri $uri/ /index.html; + } + + # Redirect /react-components to /react-components/ + location = /react-components { + return 301 /react-components/; + } + + # Redirect 404 errors to the Design System landing page + error_page 404 =301 https://gov.bc.ca/designsystem; } }