Skip to content

CORS Problem after deploying docker separately question #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DxMikel opened this issue May 8, 2025 · 4 comments
Open

CORS Problem after deploying docker separately question #541

DxMikel opened this issue May 8, 2025 · 4 comments

Comments

@DxMikel
Copy link

DxMikel commented May 8, 2025

Using documentation for deploy on docker separately I create both docker images and running put all de environments as described but when finish configurate an error appears after looking for console dev tools realize I have CORS Error what am I doing wrong with configuration or did I misunderstand something on variable?

I am using latest docker version for both

environment for backend:

APP_KEY=base64:G/ZFls3t
APP_SAAS_MODE_ENABLED=true
APP_FRONTEND_URL=https://evento.gymbalalai.com
APP_SAAS_STRIPE_APPLICATION_FEE_PERCENT=1.5
FILESYSTEM_PUBLIC_DISK=public
FILESYSTEM_PRIVATE_DISK=local
JWT_SECRET=ewb9o
LOG_CHANNEL=stderr
DB_CONNECTION=pgsql
DB_HOST=
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=

environment for frontend:
VITE_FRONTEND_URL=https://evento.gymbalalai.com
VITE_API_URL_CLIENT=https://eventoback.gymbalalai.com/api
VITE_API_URL_SERVER=https://eventoback.gymbalalai.com/api

Image

Image

@daveearley
Copy link
Contributor

Hi @DxMikel,

The issue is likely that you have not updated the CORS_ALLOWED_ORIGINS environment variable. If you add https://eventoback.gymbalalai.com it should work.

Thanks for flagging this, as the information was missing from the docs. I've updated the docs.

@DxMikel
Copy link
Author

DxMikel commented May 12, 2025

Hi @daveearley,
thanks for answer me unfortunely it doesn't work I try different configuration for environment variables on both cases I add CORS_ALLOWED_ORIGINS

frontend env variables
VITE_FRONTEND_URL=https://evento.gymbalalai.com
VITE_API_URL_CLIENT=https://eventoback.gymbalalai.com/api
VITE_API_URL_SERVER=https://eventoback.gymbalalai.com/api

backend env
CORS_ALLOWED_ORIGINS=https://evento.gymbalalai.com

Image

even I try to change frontend variable to
VITE_FRONTEND_URL=https://evento.gymbalalai.com
VITE_API_URL_CLIENT=https://evento.gymbalalai.com/api
VITE_API_URL_SERVER=https://evento.gymbalalai.com/api

but another issue is happening and don't know why

Image

Image

Image

and when this happen on database I don't have any user create

also looking for another backend env I add both
CORS_ALLOWED_ORIGINS=https://evento.gymbalalai.com,https://eventoback.gymbalalai.com

and cors issue still appearing

still don't know what env variable I misconfigured

@HiEventsDev HiEventsDev deleted a comment May 13, 2025
@daveearley
Copy link
Contributor

Chrome is quite poor for diagnosing CORS errors, but if you open Firefox you can see the preflight OPTIONS request is failing and returning a 502 Bad Gateway error.

Image

How are you deploying your containers?

@DxMikel
Copy link
Author

DxMikel commented May 13, 2025

I'm using portainer as Docker Management and pulling image from documentation
daveearley/hi.events-frontend
daveearley/hi.events-backend
not sure why it has 502 error on logs it shows ok

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants