N
Novu5mo 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 Inkeep5mo 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 Inkeep5mo 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 Inkeep5mo ago
Got it. Tagging @Support for additional help.
Want results from more Discord servers?
Add your server