Closed Yberion closed 8 months ago
This is working as expected. The proxy only effect requests coming from the browser.
Hello @alan-agius4, the problem is that it works fine without SSL enabled (on SSR), even on the server side rendering.
If I'm following what you said, how are we able to test the SSR if the proxy only affect request from the browser ?
Saying it again, the problem only occur when we enable the SSL (on SSR).
Let me take another look.
I think some NodeJS versions will work fine. I've the same issue but I also couldn't find any solution. NODE_TLS_REJECT_UNAUTHORIZED didn't work for me. My working nodejs version: 16.15.1
I have got the same error angular ssr when request to localhost
Same error when use certificated auto seft i solve use NODE_TLS_REJECT_UNAUTHORIZED set to 0. Addicionally also usage the previous , change my httpClient to fetch in Angular 17 , and fixed the error. But if usage by default httpClient throw error same error this post ? why ? not idea not show more information that unknown error
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
π Bug report
What modules are related to this issue?
ssr-dev-server
)Is this a regression?
No idea.
Description
When using the proxy (
proxy.conf.js
+"proxyConfig": "proxy.conf.js"
) with@nguniversal/builders:ssr-dev-server
andssl
enabled (ssl + cert + key), it seems that I cannot take advantage of the proxy when rendering the page on the server.Works fine without SSL.
I'm getting an error when trying to access
https://localhost:4200/
because of the call to the API that require the proxy to work.With
ng serve
everything works perfectly even with SSL.Maybe there's something I'm missing or don't understand.
π¬ Minimal Reproduction
On the
HomeComponent
, I'm making 2 requests to the same API, the first one directly calling the real full url, the second request that need the proxy to "redirect" the call (this one fail with SSR + SSL).There's an API interceptor to rewrite the url in Platform Server. (
src\app\core\interceptors\api.interceptor.ts
)feature/ssr-dev-ssl
npm i
npm run start:ssr:fastify:development
ornpm run start:ssr:express:development
You can disable SSL on
serve-ssr-express
/serve-ssr-fastify
and test that it works.The strange part is that if I directly call
https://localhost:4200/api/chuck-norris/jokes/random
it works fine (but then It's not calling the render function, so there's something with that).π₯ Exception or Error
π Your Environment
(Also having the problem with
Angular 14
)