• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Docker // The plain HTTP request was sent to HTTPS port

sabietzki

New Pleskian
Server operating system version
Ubuntu 22
Plesk version and microupdate number
18.0.44
Hello,
i have a docker container and added a rule to one of my domains. on port 80 the docker containers works very well. But when i change the proxy rules to port 443 (docker internal) i getting 400 Bad Request The plain HTTP request was sent to HTTPS port - error. what can i do?
 
Hi,

Plesk will add a little piece of configuration to your nginx configuration for your domain when setting up Docker Proxy Rules. The docker extension is, quite frankly, very limited in this regard and will always proxy your request to http://0.0.0.0:<port>.

When you're accessing your domain via https://example.com it will internally access http://0.0.0.0:<port> (note the missing s). This is fine if your docker application serves data over http, but if it requires https you'll get your 400 Bad Request error.

One way to temporarily fix this is to edit your domain configuration, usually located at:
/var/www/vhosts/system/<domain>/conf/nginx.conf

Scroll down a bit and somewhere in there you'll see:
Code:
#extension docker begin
location ~ ^/.* {
        proxy_pass http://0.0.0.0:<port>;
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
}
#extension docker end

Change http:// to https:// and restart nginx. Depending on your distro this could be as easy as: service nginx reload.

PLEASE NOTE: these changes are NOT permanent. Modifying the domain hosting configuration using the Plesk interface could easily reset or override this. Keep this in mind.

For the Plesk team:

It would be great if you added a new option to allow proxying the request using the https;// handler. Something like this perhaps?
plesk.jpg

Cheers,
 
Back
Top