Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal server error for @next/image images when hosting on AWS #27453

Closed
dclipca opened this issue Jul 24, 2021 · 5 comments
Closed

500 Internal server error for @next/image images when hosting on AWS #27453

dclipca opened this issue Jul 24, 2021 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@dclipca
Copy link

dclipca commented Jul 24, 2021

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

v16.5.0

What browser are you using?

Brave and Firefox

What operating system are you using?

Ubuntu

How are you deploying your application?

AWS EC2

Describe the Bug

Every @next/image image isn't loaded. I am getting 500 Internal server errors for every @next/image images when hosting on an AWS EC2. The non-@next/image work fine. Same story on Next 10. Everything works fine on localhost.

I am using the commands

npx next build
npx next start -p 80

Expected Behavior

The @next/image images should load.

To Reproduce

Create a new website with Next. Run:
npx next build
npx next start -p 80

@dclipca dclipca added the bug Issue was opened via the bug report template. label Jul 24, 2021
@wadehammes
Copy link

Did you add your server host name to the next.config for images?

module.exports = {
  images: {
    domains: [
      "images.ctfassets.net",
    ],
  },
}

@chaosd3v
Copy link

Faced similar issue, adding the domains solved the issue

@styfle
Copy link
Member

styfle commented Jul 28, 2021

Sounds like missing config. Make sure that next.config.js is present when running next build.

It also could be related to #23523 which is fixed on canary (yarn add next@canary)

@ijjk
Copy link
Member

ijjk commented Sep 18, 2021

Closing per above, if you are still having trouble with this feel free to respond with additional info!

@ijjk ijjk closed this as completed Sep 18, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

6 participants