File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/angular/build/src/builders/dev-server Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -681,7 +681,15 @@ export async function setupServer(
681
681
headers : serverOptions . headers ,
682
682
// Disable the websocket if live reload is disabled (false/undefined are the only valid values)
683
683
ws : serverOptions . liveReload === false && serverOptions . hmr === false ? false : undefined ,
684
- proxy,
684
+ // When server-side rendering (SSR) is enabled togather with SSL and Express is being used,
685
+ // we must configure Vite to use HTTP/1.1.
686
+ // This is necessary because Express does not support HTTP/2.
687
+ // We achieve this by defining an empty proxy.
688
+ // See: https://github.com/vitejs/vite/blob/c4b532cc900bf988073583511f57bd581755d5e3/packages/vite/src/node/http.ts#L106
689
+ proxy :
690
+ serverOptions . ssl && ssrMode === ServerSsrMode . ExternalSsrMiddleware
691
+ ? ( proxy ?? { } )
692
+ : proxy ,
685
693
cors : {
686
694
// Allow preflight requests to be proxied.
687
695
preflightContinue : true ,
You can’t perform that action at this time.
0 commit comments