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 @@ -692,7 +692,15 @@ export async function setupServer(
692692 headers : serverOptions . headers ,
693693 // Disable the websocket if live reload is disabled (false/undefined are the only valid values)
694694 ws : serverOptions . liveReload === false && serverOptions . hmr === false ? false : undefined ,
695- proxy,
695+ // When server-side rendering (SSR) is enabled togather with SSL and Express is being used,
696+ // we must configure Vite to use HTTP/1.1.
697+ // This is necessary because Express does not support HTTP/2.
698+ // We achieve this by defining an empty proxy.
699+ // See: https://github.com/vitejs/vite/blob/c4b532cc900bf988073583511f57bd581755d5e3/packages/vite/src/node/http.ts#L106
700+ proxy :
701+ serverOptions . ssl && ssrMode === ServerSsrMode . ExternalSsrMiddleware
702+ ? ( proxy ?? { } )
703+ : proxy ,
696704 cors : {
697705 // Allow preflight requests to be proxied.
698706 preflightContinue : true ,
You can’t perform that action at this time.
0 commit comments