I'm following the instructions on Next.js' documentation to start the server using Docker: https://nextjs.org/docs/deployment#docker-image
Loading the site with http works but https returns SSL protocol errors.
What I did in detail:
Configured NGINX and cerbot (note that the guide is for Ubuntu 20) https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal on my DigitalOcean Ubuntu 22.4 server
Copied
Dockerfile
and.dockerignore
from the example project linked in the docs to my project: https://github.com/vercel/next.js/tree/canary/examples/with-dockerBuilt and uploaded the image to the server.
Started the image on the server:
docker run -p 80:3000 -p 443:3000 my_image
HTTP works perfectly (https://mysite.mydomain
). With HTTPS I get errors, e.g. ERR_SSL_PROTOCOL_ERROR
on Chrome and SSL_ERROR_RX_RECORD_TOO_LONG
on Firefox.
Any ideas?