# Deploy rasa on a ssl enabled server

**URL:** <https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763>\
**Category:** Rasa Open Source\
**Created:** [September 15, 2020, 8:57am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763 "2020-09-15T08:57:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnikaTabassum](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anikatabassum/32/6935_2.png) [@AnikaTabassum](https://forum.rasa.com/u/AnikaTabassum)\
**Post date:** [September 15, 2020, 8:57am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/1 "2020-09-15T08:57:44Z")

</div>

Hi. I have deployed a rasa bot in my server. but now enabled ssl today. now I need to run rasa with https. I am trying to do this with nginx. Can anyone help me with what changes should I make to my nginx.conf file?  
Is there any way to get the webhook suppose **url: “[http://192.168.20.62:5005/webhooks/rest/webhook](http://192.168.20.62:5005/webhooks/rest/webhook)”** to **url: “[https://192.168.20.62:5005/webhooks/rest/webhook](https://192.168.20.62:5005/webhooks/rest/webhook)”** In short, I just want to change my url to https. Is it possible?

---

<div class="post-metadata">

**Author:** ![a-anand-91119](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/a-anand-91119/32/10664_2.png) [@a-anand-91119](https://forum.rasa.com/u/a-anand-91119)\
**Post date:** [September 15, 2020, 5:09pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/2 "2020-09-15T17:09:56Z")

</div>

You can use ssl for your nginx and then use as a reverse proxy to pass requests to your rasa server. You can see a sample config below

```
upstream rasa{
server rasa:5005 # your rasa server ip and port
}

server {
listen 443 ssl;
server_name 127.0.0.1;

ssl_certificate <CERTIFICATE PATH>
ssl_certificate_key <CERTIFICATE KEY>
ssl_trusted_certificate <CA PATH>

location /{
    proxy_pass https://rasa
}
}
```

---

<div class="post-metadata">

**Author:** ![AnikaTabassum](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anikatabassum/32/6935_2.png) [@AnikaTabassum](https://forum.rasa.com/u/AnikaTabassum)\
**Post date:** [September 16, 2020, 8:29am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/3 "2020-09-16T08:29:26Z")

</div>

thank you so much. I am trying this. but one more thing… everytime i start nginx i get **nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)** i know this is because port 80 is already being used by http. and if i try to stop the process which is running n port 80, naturally I can’t connect to my server anymore. Do you have any solution regarding this?

---

<div class="post-metadata">

**Author:** ![AnikaTabassum](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anikatabassum/32/6935_2.png) [@AnikaTabassum](https://forum.rasa.com/u/AnikaTabassum)\
**Post date:** [September 16, 2020, 9:17am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/4 "2020-09-16T09:17:20Z")

</div>

okay I managed to run nginx on a different port (example: 7777). but now I am getting this error:

> jquery.min.js:2 Mixed Content: The page at ‘https://my\_domain.com:7777/’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘[http://XX.XX.XX.XX:5005/webhooks/rest/webhook](http://XX.XX.XX.XX:5005/webhooks/rest/webhook)’. This request has been blocked; the content must be served over HTTPS.

any idea on how do I run rasa with https?

---

<div class="post-metadata">

**Author:** ![a-anand-91119](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/a-anand-91119/32/10664_2.png) [@a-anand-91119](https://forum.rasa.com/u/a-anand-91119)\
**Post date:** [September 16, 2020, 1:33pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/5 "2020-09-16T13:33:01Z")

</div>

If your website is using https, then you cannot make http calls. There are two ways to tackle this.

1. You should create an ssl certificate and start rasa server using ssl. [[HTTPS for RASA](https://rasa.com/docs/rasa/user-guide/configuring-http-api/#configuring-ssl-https)]
2. You can use Nginx as a reverse proxy to redirect calls to an http rasa server.

For the second approach, you can add the following location section under your server config section ins nginx config file.

```
                location ~ ^/rasa([^\?]+)(\?.*)? {
                    resolver 127.0.0.11 valid=30s;

                    set $rasa_server http://rasa:5005$1?$args;

                    proxy_http_version 1.1;
                    proxy_cache_bypass $http_upgrade;

                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";

                    proxy_pass $rasa_server;
                    proxy_read_timeout 300;
            }

```

This will pass all requests coming to `your_domain/rasa` to the rasa server (in my case a docker container listening to port 5005). If there are any arguments, then they are also passed. (you’ll need this for [socket.io](http://socket.io) over https)

---

<div class="post-metadata">

**Author:** ![AnikaTabassum](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anikatabassum/32/6935_2.png) [@AnikaTabassum](https://forum.rasa.com/u/AnikaTabassum)\
**Post date:** [September 16, 2020, 2:06pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/6 "2020-09-16T14:06:43Z")

</div>

Thank you so much. I’ve been able to run rasa with my ssl certificate with the following command

> rasa run --ssl-certificate /path\_to\_folder/mydomain.crt --ssl-keyfile /path\_to\_folder/mydomain.key --m ./models --endpoints endpoints.yml --port 5005 -vv --enable-api --cors “\*” --credentials credentials.yml

And I am running nginx with another port. So that solves my problem. Thanks 😃

---

<div class="post-metadata">

**Author:** ![vanshkapil](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/vanshkapil/32/12378_2.png) [@vanshkapil](https://forum.rasa.com/u/vanshkapil)\
**Post date:** [December 20, 2020, 8:28am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/7 "2020-12-20T08:28:42Z")

</div>

Hi Anand, I am trying to connect RASA open source bot with a web chat widget through socketio. While the server is running, bot is working fine locally but its not showing up locally .

My docker containers are running. And when I hit my domain I get this ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/e/e1f624e7b755dd66bffc6f2c480c1c7706ec6e19.png)

my .conf file looks like this

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/783700195c3f2b0ed718224c86ab962b51daac68.png)

---

<div class="post-metadata">

**Author:** ![a-anand-91119](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/a-anand-91119/32/10664_2.png) [@a-anand-91119](https://forum.rasa.com/u/a-anand-91119)\
**Post date:** [December 31, 2020, 12:52pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/8 "2020-12-31T12:52:15Z")

</div>

> [@vanshkapil](#):
>
> bot is working fine locally but its not showing up locally .

can you elaborate

---

<div class="post-metadata">

**Author:** ![santhosh432](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/santhosh432/32/13332_2.png) [@santhosh432](https://forum.rasa.com/u/santhosh432)\
**Post date:** [February 25, 2021, 4:48pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/9 "2021-02-25T16:48:50Z")

</div>

Hi Anika, Hope you are good . Are you able to run with ssl in nginx file settings, instead of cmd which is mentioned above.? . If it is there please share the file of nginx.

Thanks.

---

<div class="post-metadata">

**Author:** ![rashmi\_49](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@rashmi\_49](https://forum.rasa.com/u/rashmi_49)\
**Post date:** [April 26, 2021, 8:13am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/10 "2021-04-26T08:13:37Z")

</div>

Hello @a-anand-91119 hope you doing well!

> Blockquote

Actually I’m stuck at some point in my project where simply i deployed my chat-bot on a local server and connected it to a website which is running on another server . what issue i’m facing is that the request to my rasa server is being block because the website is using SSL and my server is not accepting it because i did not initialise SSL in it till now.How i confirm it, by doing a test When i stopped SSL at web end the rasa server also started getting request so that’s what i know that there is some problem at the SSL request.

> Blockquote

What i want to know is how can i apply your 2nd approach which you have mentioned “2. You can use Nginx as a reverse proxy to redirect calls to an http rasa server”

> Blockquote

and where i need to write these

`Preformatted text` location ~ ^/rasa([^?]+)(?.\*)? { resolver 127.0.0.11 valid=30s;

```
                set $rasa_server http://rasa:5005$1?$args;

                proxy_http_version 1.1;
                proxy_cache_bypass $http_upgrade;

                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";

                proxy_pass $rasa_server;
                proxy_read_timeout 300;
        }

```

> Blockquote

code of line in my project. Sorry in advance that i can not share my project due to some policy.

> Blockquote

What i have done is : installed nginx in my ubuntu 18.04 and using rest api for the endpoint channel not socket io. And I’m a beginner for this project so don’t know what to do next. It will be very helpful if you could help me in here. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![uuu789](https://avatars.discourse-cdn.com/v4/letter/u/b38774/32.png) [@uuu789](https://forum.rasa.com/u/uuu789)\
**Post date:** [November 6, 2021, 10:36pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/11 "2021-11-06T22:36:24Z")

</div>

Hello, Where should I write this configuration? I have no idea about this subject. Can you help please. Note: I use 2 servers for my project, one for rasa and the other for nginx.

---

<div class="post-metadata">

**Author:** ![InnoOmnia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/innoomnia/32/17290_2.png) [@InnoOmnia](https://forum.rasa.com/u/InnoOmnia)\
**Post date:** [November 8, 2021, 8:14am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/12 "2021-11-08T08:14:25Z")

</div>

Here

> /etc/nginx/sites-available

---

<div class="post-metadata">

**Author:** ![himanshuteotia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/himanshuteotia/32/4876_2.png) [@himanshuteotia](https://forum.rasa.com/u/himanshuteotia)\
**Post date:** [June 3, 2022, 8:14pm UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/13 "2022-06-03T20:14:11Z")

</div>

> [@a-anand-91119](#):
>
> `proxy_read_timeout 300;`

I am facing a similar issue with `callback_url` while training the bot. Actually, I am using the NodeJS server to handle callback\_url so the problem is when I run both servers on the same machine it works but if I run the rasa server on a different machine I don’t get the stream of the file.

---

<div class="post-metadata">

**Author:** ![tanvir\_ishraq](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tanvir\_ishraq](https://forum.rasa.com/u/tanvir_ishraq)\
**Post date:** [June 7, 2022, 7:06am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/14 "2022-06-07T07:06:46Z")

</div>

hello anika, how did you generate ssl certificate? I used openssl to create self-signed certificate and i was wondering if you did the same…

---

<div class="post-metadata">

**Author:** ![tanvir\_ishraq](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tanvir\_ishraq](https://forum.rasa.com/u/tanvir_ishraq)\
**Post date:** [June 7, 2022, 8:47am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/15 "2022-06-07T08:47:19Z")

</div>

@AnikaTabassum

---

<div class="post-metadata">

**Author:** ![AnikaTabassum](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anikatabassum/32/6935_2.png) [@AnikaTabassum](https://forum.rasa.com/u/AnikaTabassum)\
**Post date:** [June 9, 2022, 4:32am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/16 "2022-06-09T04:32:31Z")

</div>

Yes did the same.

---

<div class="post-metadata">

**Author:** ![tanvir\_ishraq](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tanvir\_ishraq](https://forum.rasa.com/u/tanvir_ishraq)\
**Post date:** [June 27, 2022, 4:48am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/17 "2022-06-27T04:48:03Z")

</div>

hello there @AnikaTabassum. did you also use docker? and will you please share your nginx.conf file? I am pretty new to nginx and it would help me set up connections.

---

<div class="post-metadata">

**Author:** ![tanvir\_ishraq](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tanvir\_ishraq](https://forum.rasa.com/u/tanvir_ishraq)\
**Post date:** [August 1, 2022, 6:13am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/18 "2022-08-01T06:13:28Z")

</div>

I have switched to ngrok to move rasa to https. seems to be an easier solution.

---

<div class="post-metadata">

**Author:** ![athenasaurav](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/athenasaurav/32/8139_2.png) [@athenasaurav](https://forum.rasa.com/u/athenasaurav)\
**Post date:** [August 1, 2022, 6:29am UTC](https://forum.rasa.com/t/deploy-rasa-on-a-ssl-enabled-server/33763/19 "2022-08-01T06:29:49Z")

</div>

Hello Everyone,

Whom so ever is facing this issue can look at the repo of mine for a detailed process.

> **[GitHub - athenasaurav/pizza-bot](https://github.com/athenasaurav/pizza-bot)**
>
> Contribute to athenasaurav/pizza-bot development by creating an account on GitHub.

Please use readme file to do the necessary steps.
