Dear All,
I have build simple project, when make mix phx.gen.auth Accounts User users in local development it’s working but when try upload into production, the login auth is error like below :
Do you see any error logs on the server or in the console? A common issue is forgetting to add your domain to the allowed origins list.
I am using NGINX with the configuration like below :
server_name mydomain.com www.mydomain.com;
if ($host = www.mydomain.com) {
return 301 $scheme://mydomain.com$request_uri;
}
location / {
allow all;
# Proxy Headers
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Cluster-Client-Ip $remote_addr;
# WebSockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://phoenix;
}
Does I miss some configuration in my phoenix app ?
What do you have configured in your check_origin
value in your Phoenix config? Also, did you see my question regarding error logs?
Dear Sir,
I don’t know to see the error logs in production mode
And I don’t know the exact line code to configure that,
it’s solved thankyou Sir
I forgot to change the example.com to my domain name in folder config the file runtime.exs
host = System.get_env("PHX_HOST") || "example.com"
become
host = System.get_env("PHX_HOST") || "mydomain.com"