Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.20.62:5005/webhooks/rest/webhook. (Reason: CORS request did not succeed)

Hi… I am building a chatbot using rasa. I have to deploy my bot on a linux server. So I am using nginx and running rasa at the backend… i call rasa with an ajax call from my javascript file…

my rasa version is : Rasa 1.7.1

nginx version: 1.16.1

I am running rasa with the following commands:

rasa run actions

python -m rasa run --m ./models --endpoints endpoints.yml --port 5005 -vv --enable-api --cors "*"

when i hit my ip… I can use rasa perfectly… but everyone other in my lan gets the following error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.20.62:5005/webhooks/rest/webhook. (Reason: CORS request did not succeed).

this is my endpoint file:

action_endpoint:
    url: "http://192.168.20.62:5055/webhook"

i have tried all the solutions given in the forum but i am stuck here for days :frowning: can anyone help me with this please?

Hey @AnikaTabassum, I see that you’re already using the --cors argument. The problem still appears to be related to CORS, however. Is there a chance it might be an Nginx configuration problem? Two things I would try are:

  1. Removing Nginx and having other people access port 5005 directly to see if it works
  2. Configuring Nginx in a way that enables it to handle CORS preflight requests (maybe enable cross-origin resource sharing will help, but I haven’t tried it personally)

Thanks! I found out that my 5005 port was blocked! I enabled the port by giving these commands in the terminal:

sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5005 -j ACCEPT

sudo /sbin/iptables-save

1 Like