Applicable to:
- Plesk for Linux
Symptoms
-
Configuring Docker Proxy Rules for a Docker container that binds HTTPS returns this error on the website:
502 Bad Gateway
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please. -
After adding a Docker Proxy Rule in Domains > example.com > Docker Proxy Rules, Plesk adds
proxy_pass
configuration using HTTP:location ~ ^/.* {
proxy_pass http://127.0.0.1:9444;
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;
}
Cause
This is Docker extension issue with ID EXTDOCKER-106, which will be fixed in future updates.
Resolution
While the fix is released, add the proxy rules manually, instead of using the Plesk panel feature:
-
Log in to Plesk
-
Remove any rules from Domains > example.com > Docker Proxy Rules
-
Go to Domains > example.com > Apache & nginx
-
Add the following configuration to Additional nginx directives
location ~ ^/.* {
proxy_pass https://127.0.0.1:9444;
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;
} -
Press OK to save the changes
Comments
0 comments
Please sign in to leave a comment.