Error during WebSocket handshake

I have followed the link below and my domain me.example.com now points to my Home Assistant login page. However I am now faced with another issue - the following error occurs when I enter my username and password in an attempt to log in.
https://eladnava.com/binding-nodejs-port-80-using-nginx/

It doesn’t mater if I try to log in locally or via my domain name.

WebSocket connection to ‘ws://192.168.0.9/api/websocket’ failed: Error during WebSocket handshake:
Unexpected response code: 400

Any help is appreciated.

nginx file

server {
    listen 80;
    server_name me.example.com;

    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         "http://127.0.0.1:8123";
    }
}

http in configuration.yaml

http:
  # For extra security set this to only accept connections on localhost if NGINX is on the same machine
  # server_host: 127.0.0.1
  # Update this line to be your domain
  base_url: https://me.example.com
  use_x_forwarded_for: true
  # You must set the trusted proxy IP address so that Home Assistant will properly accept connections
  # Set this to your NGINX machine IP, or localhost if hosted on the same machine.
  trusted_proxies: 127.0.0.1