Notification center
backendUrl setting to an http novu self hosting url give me cors error
3 Replies
Hi @_7eo., I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* React Get Started
* Deploy with Docker
* API Reference
* Others
-----------------------------
Answer
If you're encountering CORS errors when setting the
backendUrl
to your self-hosted Novu instance using HTTP, it could be due to cross-origin resource sharing (CORS) policies that restrict web applications from making requests to different domains. Novu's documentation and discussions suggest a few areas to check and configure to potentially resolve this issue:
1. Configuring CORS on Your Backend: Ensure your self-hosted Novu server is configured to accept requests from the domain where your frontend application is hosted. This typically involves setting the appropriate Access-Control-Allow-Origin
headers on your server.
2. Use Your Own Backend and Socket URL: When integrating with a self-hosted Novu instance, you need to specify your backendUrl
. Make sure you're correctly specifying this in your Novu provider component (1) .
3. Check Network and Server Configuration: Ensure your network and server configuration allows cross-origin requests. This might involve checking any reverse proxy or firewall settings that could be filtering or blocking these requests.
4. Docker Deployment: If you're deploying Novu with Docker, ensure all configurations, especially environment variables, are correctly set up to reflect your deployment's actual domain and not just the localhost. This might involve adjusting the
API_ROOT_URL
and related configurations to ensure they align with your deployment setup (2) .
5. Consult the Official Documentation and Community: For specific configurations related to CORS and self-hosting, the official Novu documentation and community discussions, like those on Discord, can provide insights and solutions that others have found effective (3) (4) .
If you've already configured CORS correctly and are still facing issues, it might be beneficial to check other settings or configurations that could be affecting cross-origin requests. Sometimes, the problem could also be due to how the request is made from the frontend or an intermediary network component altering the request headers.@_7eo. this issue seems to be duplicate of https://discord.com/channels/895029566685462578/1236136554565599272