How can I deploy chatbot with nginx

I want to take the chatbot live in microsoft teams. my company wouldn’t let me use ngrok. so I set up virtual machine and also requested webserver for nginx. But I don’t know how to configure it. I have a few questions about this topic. Note: I don’t want to use Docker.

  1. How do I run rasa on nginx hosted url instead of running it on my local? Should I make changes on the backend? Where should I make a change?
  2. During the integration with teams, is it enough to write nginx’s server ip number for the host, 5005 in the port in https:// host : port /webhooks/ botframework /webhook? Do you need to do anything extra?

I’m new to these things, I would be very happy if you could help me step by step. :slight_smile: Thank you so much.

I can help you halfway, never integrated with Teams, but using Nginx. Also I don’t run Nginx in docker container. I can help you to with Nginx, but what Teams wants and how it is connected, I don’t know.

Have you looked this?

Integrate Rasa bot with microsoft teams - #15 by amir

If you could help me with nginx, I would be very happy, at least I would have done that part.

Ok, what is your developing environment?

I am using visual studio code for IDE

ok, so where you running Visual Studio. Windows? Linux? Apple? Own computer? Cloudserver?

It is runnig on Windows . installed on my own computer, also in a virtual machine.

ok, you first test it in virtual machine (Oracle Virtuabox?) but is your final chatbot running in your windows machine or where?

I made the developments from my own computer on Windows. But the chatbot will run on a virtual machine (VMware) in a live environment. And test will also be in virtual machine

ok, then you should same OS in your developing environment than in running VMvare, so what is OS there?

there is also the OS Windows

Even I don’t recommend windows as development environment, follow this tutorial to install Nginx to Windows

https://www.youtube.com/watch?v=C_0yEMHDm5w

nginx is already installed on a different server. I have 2 servers right now, one for web service (nginx) and the other for rasa.

Ok, then you need to use IP address or Domain names, when configuring Nginx to connect to separate Rasa server.

Again not a system I would use, but it is ok.

Well, how can I connect to Rasa Server, how should I configure it, could you please give some information?

puth this to your Nginx config

server {

   server_name ammabotti1.omnia.fi;
   index index.php index.html index.htm index.nginx-debian.html;
   root /var/www/html/amva/;

   location / {
   proxy_pass http://ammabotti1.omnia.fi:444;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $remote_addr;
   proxy_set_header Host $host;
   }

and replace server_name to how outside world, internet users, connect to your bot, and then replace proxy_pass to ip/web adress where your rasa server is running

I don’t understand exactly where to write this. Should I create and write a new file to the folder where rasa is located (ie where the domain.yml or endpoints.yml files are located)? nginx.config extension.

location is here

/etc/nginx/sites-available

name you want it

[paulii@vetbot-v4 /sites-available TUOTANTO]$ ls -l
total 20
-rw-r--r-- 1 root root  2418 May 31 13:53 default
-rw-r--r-- 1 root root 13395 Oct 27 15:14 tuotantoProxy

and then enable it

  • sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Thanks a lot for your answer. I can’t test it on servers right now due to technical problems. I will try as soon as possible. I may need support again :slight_smile:

1 Like

Hello,

Where do I need to define the ip address of nginx on the server where rasa is installed?