File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
context/storybook/etc/nginx/templates Expand file tree Collapse file tree 2 files changed +28
-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
162+ your viteFinal configuration `.storybook/main.ts`
163+
164+ ` ` ` typescript
165+ async viteFinal(config) {
166+ const { mergeConfig } = await import("vite");
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 1+ map $http_upgrade $connection_upgrade {
2+ default upgrade;
3+ '' close;
4+ }
5+
16server {
27
38 include include.d/ssl.conf;
@@ -9,6 +14,11 @@ server {
914 proxy_set_header Host $host;
1015 proxy_set_header X-Real-IP $remote_addr;
1116 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
17+
18+ # WebSocket support for Vite-based Storybook
19+ proxy_set_header Upgrade $http_upgrade;
20+ proxy_set_header Connection $connection_upgrade;
21+ proxy_read_timeout 86400;
1222 }
1323
1424 location /__webpack-hmr {
You can’t perform that action at this time.
0 commit comments