Plug.SSL redirects socket connection problem 301

Hi everyone!

I’m trying to connect with websockets but is not working when I deploy it I get this message in the server:

Plug.SSL is redirecting GET /socket/websocket to https://pelable.com with status 301

On localhost the connection and the chat channel work correctly so I’m guessing I need to change something in the configuration but not sure what in order to make it work

This is my prod.exs file:

use Mix.Config

config :pelable, PelableWeb.Endpoint,
  http: [:inet6, port: System.get_env("PORT") || 4000],
  url: [scheme: "https", host: System.get_env("RENDER_EXTERNAL_HOSTNAME") || "localhost", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
  cache_static_manifest: "priv/static/cache_manifest.json"

config :logger, level: :info

And I’m using releases.exs:

import Config
config :pelable, PelableWeb.Endpoint,
  http: [:inet6, port: System.get_env("PORT") || 4000],
  url: [scheme: "https", host: "pelable.com", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
  cache_static_manifest: "priv/static/cache_manifest.json",

config :logger, level: :info
config :pelable, PelableWeb.Endpoint, server: true

config :pelable, PelableWeb.Endpoint,
  secret_key_base: System.get_env("SECRET_KEY_BASE")

config :pelable, Pelable.Repo,
  ssl: true,
  database: System.get_env("DATABASE_URL"),
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")

deleted the line:

force_ssl: [rewrite_on: [:x_forwarded_proto]]

from prod.exs and is now working :slightly_smiling_face::

updated prod.exs:

use Mix.Config

config :pelable, PelableWeb.Endpoint,
  http: [:inet6, port: System.get_env("PORT") || 4000],
  url: [host: System.get_env("RENDER_EXTERNAL_HOSTNAME") || "localhost", port: 80],
  cache_static_manifest: "priv/static/cache_manifest.json"

config :logger, level: :info

updated releases.exs:

import Config
config :logger, level: :info

config :pelable, PelableWeb.Endpoint, server: true

config :pelable, PelableWeb.Endpoint,
  secret_key_base: System.get_env("SECRET_KEY_BASE")

config :pelable, Pelable.Repo,
  ssl: true,
  database: System.get_env("DATABASE_URL"),
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")