File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
context/storybook/etc/nginx/templates Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,24 @@ environment:
158158 NGINX_PROXY_PASS: http://app:6006
159159` ` `
160160
161+ If your're using Vite-based Storybook, you need to add the following lines to your viteFinal configuration `.storybook/main.ts`
162+
163+ ` ` ` typescript
164+ async viteFinal(config) {
165+ const { mergeConfig } = await import("vite");
166+
167+ return mergeConfig(config, {
168+ // Existing config...
169+ server: {
170+ hmr: {
171+ clientPort: 443,
172+ protocol: "wss",
173+ },
174+ },
175+ });
176+ },
177+ ` ` `
178+
161179# ## Drupal
162180
163181Drupal is a configuration that forwards PHP-FPM requests to a Drupal
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ server {
99 proxy_set_header Host $host;
1010 proxy_set_header X-Real-IP $remote_addr;
1111 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12+
13+ # WebSocket support for Vite-based Storybook
14+ proxy_set_header Upgrade $http_upgrade;
15+ proxy_set_header Connection "Upgrade";
16+ proxy_read_timeout 86400;
1217 }
1318
1419 location /__webpack-hmr {
You can’t perform that action at this time.
0 commit comments