Struggling to connect rasa to a web interface

I apologise in advance for what I am sure is a trivial issue, but having spent a few hours going through the docs and various blogs, I’m no further on and becoming frustrated.

I have a simple bot, which works fine via shell.

I have a small web server, and I’m trying to deploy the bot via the guide here:

I have created a simple page, added a break in the firewall of the VPS for port 5005 and started rasa using the command

rasa run --debug --enable-api --cors "*"

I have added the following to endpoints.yml

#web
action_endpoint:
url: "http://localhost:5005/webhook"

and the following to credential.yml

`socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: false`

Yet when I try and access the bot, I get nothing. I can see the widget and type entries into to, but the bot isn’t responding. Running rasa using debug suggests my prompts are not reaching it.

Inspecting the widget, I notice the following CORS errors:

Access to XMLHttpRequest at '[URL]:5005/?EIO=4&transport=polling&t=OPc9hMR' from origin '[URL]' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have redacted my URL with [URL]

I’m sure I have missed something trivial or basic, but any help would be really appreciated.

VBK

1 Like

Connecting Rasa to a web interface involves several steps, including building a web server, integrating the Rasa bot, and deploying the interface. If you’re struggling with this process, here are some tips that may help:

  1. Make sure that Rasa is running and accessible through its API. You can test this by sending a message to the bot through the Rasa API.
  2. Choose a web framework or platform to build your interface, such as Flask, Django, or Facebook Messenger.
  3. Integrate Rasa into your chosen web framework using the appropriate Rasa SDK or API.
  4. Test the connection and functionality of your web interface by sending messages and receiving responses from the Rasa bot.
  5. Deploy your web interface to a server or cloud platform for public access. If you are still struggling, consider seeking out resources and tutorials specific to your chosen web framework or platform, or reaching out to the Rasa community for additional support.

Thanks, MyCentura

Thank you.

I was hoping for something a little more specific, as I am following the guide outlined here:

https://rasa.com/docs/rasa/connectors/your-own-website/

I’m guessing the problem lies in a lack of intergration between my web messenger (am using the stock rasa widget) and my bot.

Can anyone offer advice or even a start in relation to what to google?

So I solved, the issue, but now I have another one.

I noticed that when I start RASA it runs on http://0.0.0.0:5005, where the rasa widget was pointing to https://[IP]:5005

Dropping the ‘s’ and allowing mixed content meant that this now works.

However, is there a way to go about setting Rasa to run on https? I use apache and lets-encrypt to manage ssl for my other sites.

Sure, you need to configure your Apache on https as reverse proxy, so that Apache:443 <=> Rasa:5005. Make sure, Apache proxies the websockets correctly via UPDATE mechanism.

It seems that you are encountering CORS errors while trying to access your deployed Rasa chatbot on your website. This issue can be resolved by setting the appropriate ‘Access-Control-Allow-Origin’ header in your server’s response. Make sure the header allows requests from your website’s domain. MyCenturaHealth