-
SummaryIn one project, I have a resource with a PHP/Symfony API with its own subdomain, and now I wanted to set up another resource with a Next.js frontend using Dockerfile. In the Next.js project, I use fetch to retrieve some JSON data from the API. The API URLs are all accessible without any problems, and CORS is also set up correctly. The deployment works so far, but the API URL that is passed to the container via the environment apparently does not call the API but something else, and I get a 403 error with an HTML document that contains almost exclusively JavaScript. Dockerfile of next.js you will found here: https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile I have change to use node:24-alpine the page.js: The log tab wrotes: If I'm going to terminal and login to the bash of the container: I had previously tried Nixpack, but the deployment kept failing with error messages, and it also appears that the maximum node version is 22 (I need at least 24). Does anyone have any idea what I am doing wrong here? Do I need to configure anything else for traefik here? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
I wonder if you can start a Node REPL from the container, and see what a fetch to your resource does. As said before, it looks like there's some kind of bot protection going on, the page you are getting is trying to download one of those Not sure the wget error is related, I think it can fail if you don't have write permissions to the current folder? |
Beta Was this translation helpful? Give feedback.
I wonder if you can start a Node REPL from the container, and see what a fetch to your resource does.
As said before, it looks like there's some kind of bot protection going on, the page you are getting is trying to download one of those
wait a moment, verifying you are a humanchallenges.Not sure the wget error is related, I think it can fail if you don't have write permissions to the current folder?