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?
Cheers,