Skip to content

Commit

Permalink
Update Storybook Nginx config to send root requests to BCDS landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
ty2k committed Jul 5, 2024
1 parent 62e357f commit 8f9be90
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions packages/react-components/nginx.storybook.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 8f9be90

Please sign in to comment.