Hello, I've managed to deploy Medusa on FreeBSD but unfortunately can't login to Medusa server
Medusa server https://medusa.amr.lc
Medusa admin https://admin.amr.lc
Any suggestion please
The best ecommerce software.
1 messages · Page 1 of 1 (latest)
Hello, I've managed to deploy Medusa on FreeBSD but unfortunately can't login to Medusa server
Medusa server https://medusa.amr.lc
Medusa admin https://admin.amr.lc
Any suggestion please
The best ecommerce software.
Is your CORS setup right. Did you check your browser console to see if there’s any errors displaying.
But did you setup the CORS correctly.
Would you give it a try?
As in tell it where your backend is etc
And are you getting any errors in your browser debug JavaScript console
I deployed the backend on FreeBSD no problem.
How did you managed to the server? by rc.d script?
Yeah no issues there. 20 year FreeBSD user here 😉
Double check your CORS config
Something is denying access
Those errors always pop when you open the admin theme not logged in
What happens when you try to log in?
Yeah can you show me the logs after attempting to login
And did you seed the database
I’m on my phone right now.
I’ll try from my Mac later
its login then logout
no i didnt
Is your node_env set to production?
Also yeah, you need to seed or add a medusa user
I’ve had that problem before. Try seeding the database first.
do you mean medusa migrations run
Please tell me how to seed it
I don't think the seed is needed in production
This document serves as a reference to the Medusa CLI tool including how to install it and what commands are available.
Did you test it in dev mode first
To make sure it all works
I’ve had medusa do weird things before unless I seed the DB.
Yes it was working but on localhost ports
Interesting
I’ll give it a look on my Mac in a bit and poke around to see if I can see anything
Are you running Medusa backend as is or are you proxying through caddy/nginx?
Can you show me your config
sure
server {
server_name medusa.amr.lc; # Add A record and point it to your server IP
location / { try_files $uri @medusa; }
location @medusa {
include uwsgi_params;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:9000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
Are you proxying the admin as well
curl -X GET https://medusa.amr.lc/store/products
{"products":[],"count":0,"offset":0,"limit":100}%
So i'm seeing zero products etc
You might wanna try seeding the DB
I think you might have a DB issue
No it's static build
I've seeded it but still the same
PostgreSQL
Now I've made a new store and it works
with SQlist
SQLITE
Do you like to try it
Sure
ok that works
I wonder if your database connection string is incorrect
can you show me? (X out passwords)
no
Hi the problem is not with the database it's just not working when your are in production mood
Any idea how to solve this
But what's the connect string you're using for production?
in your config where you define the database connection string for medusa backend
database_url: DATABASE_URL,
database_type: "postgres",
.env.production
show me what that looks like please (X out passwords)
Sounds like the connection string might be wrong if it works outside of production
or not passed at all
DATABASE_URL="postgres://medusa:medusa@localhost:5432/medusa"
REDIS_URL="redis://localhost:6379"
JWT_SECRET="somescret"
COOKIE_SECRET="somesecret"
#STRIPE_API_KEY=
#STRIPE_WEBHOOK_SECRET=
STORE_CORS="https://amr.lc,https://www.amr.lc"
ADMIN_CORS="https://admin.amr.lc"
it's not related to database belive me
Just wanna check all options to rule out
Ok