Fixing 400 HTTP errors when using HTTP instead of HTTPS
In this tutorial you will learn how to fix 400 HTTP errors which usually occur when HTTPS is enabled and the client is using HTTP instead, which causes the client to skip the request body entirely for
Introduction
When using HTTP -> HTTPS redirect on your Supervisely instance, you may face the problem, when all Supervisely applications would crash with same error, which in most cases, look like this in app's logs:
Full log entry for example:
So, to fix this error, you just need to change http:// part of server address to https:// in instance's settings. And there are two ways to do it:
Changing Server Address Using UI
Log in into your Supervisely instance as admin user.
In top right corner, click on your user name and select
Instance settings
from dropdown menu.Expand
Server configuration
section.In
Server address
field, changehttp://
part of server address tohttps://
(e.g.http://your-sly-instance-domain
->https://your-sly-instance-domain
).Scroll the page down and click
Save
button.
ℹ️ After changing the server address you need to re-deploy all agents, which are connected to your instance.
Changing Server Address Using Terminal
Open Supervisely directory in terminal (e.g.
cd /home/supervisely/supervisely
).Open
.env
file in your favorite text editor (e.g.nano .env
).Find
DOMAIN
variable and changehttp://
part of server address tohttps://
(e.g.http://your-sly-instance-domain
->https://your-sly-instance-domain
).Repeat the same for
SERVER_ADDRESS
variable.Save changes and close the file.
Restart Supervisely using
sudo supervisely up -d
command, otherwise changes won't take effect.
ℹ️ After changing the server address you need to re-deploy all agents, which are connected to your instance.
Last updated