N
Novu2mo ago
smart35757

depoly novu using docker compose and nginx

I'm trying to deploy novu (production) using docker compose and nginx, I got:
https://notify.example.com/auth/signup' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://novu-api:3000/v1/auth/register'. This request has been blocked; the content must be served over HTTPS.
check out the attached config files
3 Replies
Ask Inkeep
Ask Inkeep2mo ago
Hi @smart35757, 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: * AWS * Deploy with Docker * Dev Studio * Run Novu in local machine ----------------------------- Answer It appears you're encountering a mixed content issue where secure HTTPS pages are trying to load resources over an insecure HTTP connection. This commonly happens if your application is set up to use HTTPS, but internal requests are being made over HTTP. To resolve this issue for deploying Novu using Docker Compose and Nginx, you need to ensure that all internal service communications are also over HTTPS or that the Nginx configuration is correctly rewriting HTTP requests to HTTPS. Here's a general approach on how to configure Nginx to handle HTTPS requests and redirect HTTP traffic to HTTPS, which might help resolve your issue: 1. Ensure Certificates are Configured: Make sure that you have SSL certificates correctly configured for your domain in Nginx. 2. Update Nginx Configuration: Modify your Nginx configuration to redirect all HTTP traffic to HTTPS and to proxy pass HTTPS requests correctly to your Docker services. Here is an example of how you might configure your Nginx to handle HTTPS:
server {
listen 80;
server_name notify.example.com;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name notify.example.com;

ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;

location / {
proxy_pass http://novu-api:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name notify.example.com;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name notify.example.com;

ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;

location / {
proxy_pass http://novu-api:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Ask Inkeep
Ask Inkeep2mo ago
3. Configure Docker Compose Services: Ensure that your Docker Compose services are set up to communicate over HTTPS if they are exposed to the internet. This might involve configuring your services to use SSL within their configurations. 4. Environment Variables: Check if environment variables in your Docker Compose setup for Novu need to be adjusted to use HTTPS URLs. This setup ensures that all requests are redirected to HTTPS, which should help avoid mixed content issues. Make sure to replace /path/to/your/fullchain.pem and /path/to/your/privkey.pem with the actual paths to your SSL certificate files. If you're still encountering issues or need to adjust the setup based on specific requirements of Novu or your infrastructure, consider reviewing the official documentation for any additional settings or configurations required for HTTPS deployments (1) . Remember, the actual implementation details might vary based on your exact setup and requirements, so adjust the configurations accordingly. If you need more specific guidance, please provide more details about your setup or check the official Novu documentation related to deploying with Docker and using Nginx as a reverse proxy. : Deploy with Docker
Ask Inkeep
Ask Inkeep2mo ago
Got it. Tagging @Support for additional help.
Want results from more Discord servers?
Add your server
More Posts
Echo Workflow VariantsHi all I would like to try out Echo and was looking for a way how to specify variants in the docs, Does novu support sending messages to slack in markdownI want to send the message in table form in a slack channel via novu. How can this be achieved?Cannot open 'Layouts' tabWhen I click on Layouts on the novu dashboard, my page just blinks and go back to Workflows. I triedDoes the notification widget for React support WS service on a path?I'm deploying the self-hosted version to my infrastructure and have put API and WS services on a patNovu Headless - notifications not showing for custom subscriber IDsI have an app that accepts user's first name, last name, and first name. Then, it generates an ID siNot able to see the WEB UI on 4200I have been trying to setup the novu on my local machine after too many tries. i was able to run apiHow can I integrate in-app notifications in React Native?The Novu documentation contains integration guides for 'React' and other web apps. I need to integraGetting error "POST https://mydomain.com/api/v1/widgets/session/initialize 404 (Not Found)my .env example # Root URL REACT_APP_WS_URL=$HOST_NAME/ws API_ROOT_URL=$HOST_NAME/api DISABLE_USER_Firebase is forcing users to migrate from FCM to HTTP v1 (Does Novu supports HTTP v1)??Hi everyone I've got an email from firebase (check the attached email on the bottom) And I was wondWhere to report a broken Novu Cloud API?Looking at the support channel seeing little action, where should I report a broken API endpoint? h