Nextjs Image not working when hosted on port 443
Unanswered
American black bear posted this in #help-forum
American black bearOP
Nextjs Image by default makes a http request to the port where the server is hosted to retrieve images. If the server is hosted on port 443, this fails because http://localhost:443 is a URL that has an invalid protocol. So fetch request fails, and images don't get sent to the browser.
Is there any way to fix this issue without having to host the server on some other port and then using a reverse proxy on port 443?
I am using a custom server, btw.
Is there any way to fix this issue without having to host the server on some other port and then using a reverse proxy on port 443?
I am using a custom server, btw.
1 Reply
@American black bear Nextjs Image by default makes a http request to the port where the server is hosted to retrieve images. If the server is hosted on port 443, this fails because http://localhost:443 is a URL that has an invalid protocol. So fetch request fails, and images don't get sent to the browser.
Is there any way to fix this issue without having to host the server on some other port and then using a reverse proxy on port 443?
I am using a custom server, btw.
I think next image make request to whatever you put it in the src.