NuxtN
Nuxt10mo ago
6 replies
bvttercvp

Data fetching on SSR using useFetch/useAsyncData does not work on page refresh/reload

I've searched extensively but haven't found the correct solution. Here are some points I've considered:
* The site certificate is NOT self-signed, so adding NODE_TLS_REJECT_UNAUTHORIZED=0 is unnecessary.
* Setting server=false or any implementation that moves the request to the client-side is not preferred, as my goal is to use SSR for data fetching.

My SSR application is hosted in AWS, following a structure similar to the one described here (see attached image) but with CloudFront in front of ALB.
I suspect that I might be missing a specific CloudFront or other header in the request, which is automatically added on the client-side.
When running my site locally using yarn dev or yarn build, SSR data fetching works without issues.
There are also no logs found for all the SSR requests in our API log.

Has anyone encountered this same issue and is willing to share their solution?
image.png
Amazon Web Services, Inc.
Amazon ECS / AWS Fargate の AWS
Web アプリケーションにおける Amazon ECS / AWS Fargate ...
Was this page helpful?