Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ environment:
NGINX_PROXY_PASS: http://app:6006
```

If your're using Vite-based Storybook, you need to add the following lines to
your viteFinal configuration `.storybook/main.ts`

```typescript
async viteFinal(config) {
const { mergeConfig } = await import("vite");
return mergeConfig(config, {
// Existing config...
server: {
hmr: {
clientPort: 443,
protocol: "wss",
},
},
});
},
```

### Drupal

Drupal is a configuration that forwards PHP-FPM requests to a Drupal
Expand Down
10 changes: 10 additions & 0 deletions context/storybook/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

server {

include include.d/ssl.conf;
Expand All @@ -9,6 +14,11 @@ server {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# WebSocket support for Vite-based Storybook
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400;
}

location /__webpack-hmr {
Expand Down