baptisteArno / typebot.io

💬 Typebot is a powerful chatbot builder that you can self-host.
https://typebot.io
Other
7.61k stars 2.11k forks source link

Bot viewer using http:// but every think it's on and set to https:// #1676

Closed kotasdev closed 3 months ago

kotasdev commented 3 months ago

Hi,

Im hosting typebot behind Cloudflare (proxy enabled) and nginx (reverse proxy), Every think its working fine, but when i published a bot, viewer its trying to consume API by http, I rly don't understand why, every place I set https references, can some one help me?

Viewer console browser Error 892.55174397733be1ff.js:1 Mixed Content: The page at 'https://mari.kotas.plus/patrisio-teste' was loaded over HTTPS, but requested an insecure resource 'http://mari.kotas.plus/api/v1/typebots/patrisio-teste/startChat'. This request has been blocked; the content must be served over HTTPS. image image

.env

ENCRYPTION_SECRET=XXXXXXX DATABASE_URL=XXXX NODE_OPTIONS=--no-node-snapshot DEBUG=true DISABLE_SIGNUP=false NEXTAUTH_URL=https://typebot.kotas.plus NEXT_PUBLIC_VIEWER_URL=https://mari.kotas.plus NEXT_PUBLIC_CHAT_API_URL=https://mari.kotas.plus NEXTAUTH_URL_INTERNAL=http://typebot-builder:8080 # Docker internal name ADMIN_EMAIL=xxx@kotas.com.br

SMTP_USERNAME=xxx SMTP_PASSWORD=xxx SMTP_HOST=email-smtp.us-east-2.amazonaws.com SMTP_PORT=587 SMTP_SECURE=true SMTP_AUTH_DISABLED=false NEXT_PUBLIC_SMTP_FROM=xxx

baptisteArno commented 3 months ago

I don't think it has something to do with Typebot though! It is Cloudflare specific issue 🙏

abordin commented 3 months ago

I have the same Issue. despite having configured https correctly, when the viewer tries to access the bot, the access address within the json comes as http, and the browser tries to access via http Seleção_238 Seleção_239 Seleção_240 Seleção_241 Seleção_242

tech62 commented 3 months ago

I've actually the same problem with Haproxy, i've set http-request add-header X-Forwarded-Proto https if { ssl_fc } in my reverse configuration and it works !