tporto
When accessing the page she tries to load lasts about 10 seconds and reloads again and stays in that loop without stopping. When accessing the server I saw that at each attempt it shows this message in the log:
[error] Could not check origin for Phoenix.Socket transport.
Origin of the request: http://www.autoplacasma.com.br
This happens when you are attempting a socket connection to
a different host than the one configured in your config/
files. For example, in development the host is configured
to “localhost” but you may be trying to access it from
“127.0.0.1”. To fix this issue, you may either:
- update [url: [host: …]] to your actual host in the
config file for your current environment (recommended)- pass the :check_origin option when configuring your
endpoint or when configuring the transport in your
UserSocket module, explicitly outlining which origins
are allowed:
check_origin: [“https://example.com”, “//another.com:888”, “//other.com”]
prod.exs
config :autoplacas, AutoplacasWeb.Endpoint,
http: [port: 80],
url: [host: "autoplacasma.com.br", port: 80],
check_origin: ["//autoplacasma.com.br"],
code_reloader: false,
cache_static_manifest: "priv/static/cache_manifest.json"
releases.exs
config :autoplacas, AutoplacasWeb.Endpoint,
http: [:inet6, port: 80],
secret_key_base: "mysecret",
server: true,
pubsub_server: Autoplacas.PubSub,
live_view: [signing_salt: "mysalt"]
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hectorsq
Have you tried adding this
to releases.exs?
Is it already hosted at autoplacasma.com.br or is it in your local host?
Are you running it with mix phx.server or are you running the release?
tporto
It is in production. It was generated via releases. Hosted on autoplacas.com.br
tporto
I made this change and keeps giving the same message
hectorsq
This may seem obvious but which command are you using to run your app?
tporto
Service (I don’t use nginx):
releases.exs
hectorsq
Comparing with my configuration in releases.exs I found the following differences
instead of
padmaJS
Can I ask what check_origin actually is and what does it do?
riccardomanfrin
I might be totally off track, but I think yours is the key question. Because I was fooled as well I’d like to elaborate:
From doc:
Now the “origin” header from first random doc:
Caused… which is the website itself you connected to in the first place (ah-ah moment to me.. this explains why I find domain names in the “check_origin”!)
BUT assuming you have a config such this
What is the proper origin? You are conveniently told that by the console error (which I got with the default
check_origin: trueconfig):I suspect that just letting the default value
.. (maybe it’s forgetting the port? or I’m doing bad somwhere else… dunno).
trueis not actually defaulting to the origin you are prompted about in the consoleAnyway setting the whole exact string reported by the console solved for me!
Also: if you are troubleshooting start/stop/restarting your service, I’d close the tab and open a new one.. for what is worth I’ve seen strange things happening on firefox (which might well be consequence of me doing this late night).
Cheers
KevinGenus
I’m late to the game, but using Phoenix v1.7.11 on Fly.io the following showed up in my logs:
I added
check_origin: ["https://my_domain.com"]and it worked.smahi
@KevinGenus
In which config file did you set the
check_originvalue?