Host websites with Plesk
This guide is optimized for website deployment via Docker.
After deploying your Next.js site with Docker, use Plesk to route your domain to the running container via reverse proxy.
- Prerequisites:
- You completed Deploy Next.js websites with Docker.
- Your container is running on
localhost:3000
(or another port you chose). - A domain or subdomain exists in Plesk.
Add the domain in Plesk
Issue an SSL certificate (optional but recommended)
Configure Apache & Nginx reverse proxy
Click on Websites & Domains
, select your domain and click under Hosting & DNS
on Apache & nginx
Scroll down and put this in Additional directives for HTTP
and HTTPS
:
Apache-HTTP & HTTPS
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
Note
Prefer 127.0.0.1
over localhost
to avoid IPv6 resolution issues.
If you run multiple sites, map different host ports in Docker and adjust the port in the proxy rules.