Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1639

How to deploy a Next.js app on HTTPS (SSL connection) with Docker?

$
0
0

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:

  1. 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

  2. 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-docker

  3. Built and uploaded the image to the server.

  4. 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?


Viewing all articles
Browse latest Browse all 1639


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>