# Rasa server running as HTTPS not working

**URL:** <https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293>\
**Category:** Rasa Open Source\
**Created:** [September 2, 2020, 10:55am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293 "2020-09-02T10:55:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 2, 2020, 10:55am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/1 "2020-09-02T10:55:14Z")

</div>

Hi Guys ! so from past 5 days I’m trying to run rasa server as https instead of http . I have deployed my rasa server and action server using docker on GCP. The rasa server works fine as http and when i visit [http://myip:5005](http://myip:5005) , it says welcome to rasa 1.10.3 and i can communicate with it using webchat. I’ve been using this link as a reference “[Configuring the HTTP API](https://rasa.com/docs/rasa/user-guide/configuring-http-api/)” to run rasa server as https.

To generate certificates , i created a domain named datahive.chat and then pointed it to my GCP machine . I then followed this tutorial "[How To Secure Nginx with Let's Encrypt on Ubuntu 16.04 | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04) " to generate ssl certificates . Certificates were generated succesfully and when i visit [https://datahive.chat](https://datahive.chat) , it says my connection is secure .But then when i use the same certificates to run rasa server as https using this command **CMD [“run”,"-m","/app/models","–enable-api","–cors","\*","–debug","–ssl-certificate","/app/sslcerts/fullchain.pem","–ssl-keyfile","/app/sslcerts/privkey.pem"]** inside Dockerfile , it runs as https but says connection is not secure and a warning comes up .If i accept the risk and continue , rasa server works. So my question is how can i make it run as https secure connection ? Do i need to use reverse proxy using nginx or am i making some mistake?

Please help with this . Thanks in advance.

---

<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 2, 2020, 10:57am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/2 "2020-09-02T10:57:45Z")

</div>

Hi Rahul,

Rather than securing Rasa, a better approach will be use nginx to reverse proxy your rasa server and you can use your ssl certificates in the nginx configurations.

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 2, 2020, 11:03am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/3 "2020-09-02T11:03:56Z")

</div>

Hi Anand , thanks for the reply. I was thinking of using reverse proxy using nginx , but my question is why the rasa server doesn’t work with ssl certificates when given as parameters as described here "[Configuring the HTTP API](https://rasa.com/docs/rasa/user-guide/configuring-http-api/) " . The method described would save me with a lot of time and efforts.

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 2, 2020, 11:06am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/4 "2020-09-02T11:06:29Z")

</div>

@Emma@Tanja @erohmensing@alexweidauer can you guys please help me with this ? I’m stuck on this .

---

<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 2, 2020, 2:05pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/5 "2020-09-02T14:05:57Z")

</div>

@rahul_namdev

> it runs as https but says connection is not secure and a warning comes up .If i accept the risk and continue , rasa server works

for self-signed certificates this warning will be shown.

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 2, 2020, 5:14pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/6 "2020-09-02T17:14:29Z")

</div>

I used Authorized certificates also but it was not running. Anyways i used the reverse proxy thing using nginx and it is now working. I will post the steps i followed very soon so that anyone struggling with the same issue and take reference from here .

Thanks for the help @a-anand-91119 .

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 3, 2020, 5:34am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/8 "2020-09-03T05:34:28Z")

</div>

Yes [socket.io](http://socket.io) is working with ssl and reverse proxy. I’ll post how i made it work .

---

<div class="post-metadata">

**Author:** ![airnorr](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@airnorr](https://forum.rasa.com/u/airnorr)\
**Post date:** [September 4, 2020, 8:11pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/9 "2020-09-04T20:11:49Z")

</div>

Please share how you made it working

---

<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 6, 2020, 7:44am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/11 "2020-09-06T07:44:59Z")

</div>

I solved the issue I faced with [socket.io](http://socket.io) over ssl recently. What is the issue you are facing @airnorr

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [September 11, 2020, 2:42pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/12 "2020-09-11T14:42:37Z")

</div>

@airnorr @a-anand-91119 I wrote a blog describing the whole process . You can read it here

> **[Deploying Rasa Chatbot on Google Cloud with Docker - DataHive DataHive Labs](https://datahive.ai/deploying-rasa-chatbot-on-google-cloud-with-docker/)**
>
> Machine Learning Consulting, End-to-end machine learning projects, artificial intelligence and natural language processing, time series analysis, predictive analysis work

---

<div class="post-metadata">

**Author:** ![dhruvkwal](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dhruvkwal/32/13955_2.png) [@dhruvkwal](https://forum.rasa.com/u/dhruvkwal)\
**Post date:** [March 19, 2021, 1:47am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/13 "2021-03-19T01:47:53Z")

</div>

Hey! So I followed your steps and have it set up, but I can only access it using HTTP and not HTTPS. On a post request, I get the following error -

`*`SSLError: HTTPSConnectionPool(host=‘[mydomain.com](http://mydomain.com)’, port=5005): Max retries exceeded with url: /webhooks/rest/webhook (Caused by SSLError(SSLError(1, ‘[SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1123)’)))`*`

Here’s my docker-compose.yml

```
version: '3.8'
services:
  bot:
    env_file:
      - env_bot.env
    image: ${DOCKER_HUB}/${DOCKER_REPO}/${DOCKER_IMAGE}:${DOCKER_TAG}
    container_name: application_chatbot
    build:
      context: ./build
      dockerfile: Dockerfile
    #volumes:
    # - ./out:/out
    command: bash -c "python conversational_bot/start_script/launch_v2.py && /bin/sh"
    tty: true
    ulimits:
      memlock: -1
    networks:
      - organic_network
    ports:
      - 5005:5005
  mongo:
    container_name: organic_mongo_b
    image: library/mongo:latest
    volumes:
      - /tmp/mongodb:/data/db:Z
    networks:
      - organic_network
    # this should just expose this port to internal services, not to outside
    expose:
      - 27017
  nginx:
    container_name: nginx
    image: nginx
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx:/etc/nginx/conf.d
      #I kept my SSL certs in a certs folder in project directory (Make sure to include this in .gitignore)
      - ./certs:/etc/letsencrypt/live/mydomain.com
    depends_on:
      - bot
    networks:
      - organic_network

networks:
  organic_network:
   name: global_organic_network

```

and here is my nginx default conf file -

```
upstream application_chatbot {
    server application_chatbot:5005;
}

#change your domain name to localhost if testing locally
#listen on port 80 (default port for non-encrypted messages)
#if testing locally, <your_domain_name> is localhost
server {
    listen 80;
    server_name mydomain.com ;

#reverse proxy to rasa container
    location / {
        proxy_pass http://application_chatbot;
    }
}

#comment out this block if you are testing locally
#listen to port 443 (default port for encrypted messages)
server {
      listen 443 ssl;
      server_name mydomain.com ;

  #points to ssl certificates that we will move to nginx docker container in docker compose
      ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
      ssl_trusted_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;

  #reverse proxy to rasa container
      location / {
          proxy_pass http://application_chatbot;
      }
}

```

Wondering if you have any thoughts/inputs

---

<div class="post-metadata">

**Author:** ![dhruvkwal](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dhruvkwal/32/13955_2.png) [@dhruvkwal](https://forum.rasa.com/u/dhruvkwal)\
**Post date:** [March 21, 2021, 12:40am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/14 "2021-03-21T00:40:45Z")

</div>

Turns out, the nginx container wasn’t getting access to the certificates. I missed the :Z in the volume in the docker-compose.yml file.

---

<div class="post-metadata">

**Author:** ![rahul\_namdev](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@rahul\_namdev](https://forum.rasa.com/u/rahul_namdev)\
**Post date:** [April 5, 2021, 4:41pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/15 "2021-04-05T16:41:28Z")

</div>

Glad that it worked 😊

---

<div class="post-metadata">

**Author:** ![anzagh](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anzagh](https://forum.rasa.com/u/anzagh)\
**Post date:** [November 8, 2023, 6:18pm UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/16 "2023-11-08T18:18:03Z")

</div>

Hi, @rahul_namdev I have followed your blog for implementing the reverse proxy but still when I try to access with https I am getting an error curl: (35) schannel: next InitializeSecurityContext failed: SEC\_E\_INVALID\_TOKEN (0x80090308) - The token supplied to the function is invalid

Do you have any idea how to fix this so I can access with the https requests

---

<div class="post-metadata">

**Author:** ![Meenatchi\_Saravanan](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Meenatchi\_Saravanan](https://forum.rasa.com/u/Meenatchi_Saravanan)\
**Post date:** [December 4, 2023, 7:28am UTC](https://forum.rasa.com/t/rasa-server-running-as-https-not-working/33293/17 "2023-12-04T07:28:11Z")

</div>

Hi @rahul_namdev Issue on RASA HTTP API for Chatbot Integration

While implementing the RASA HTTP API through `http://<domain_name>:5005/conversations/default/trigger_intent` for integrating RASA with a chatbot in a production environment, I’m encountering mixed content errors. Is there a method to secure the URL to `https://<domain_name>:5005/conversations/default/trigger_intent` ? Also having http://\<domain\_name\>:5005/webhooks/rest/webhook . Are we able to make this as an https ?

I’m encountering an issue with my nginx configuration. When my webpage loads, it internally calls HTTP endpoints like http://\<domain\_name\>:5005/webhooks/rest/webhook and http://\<domain\_name\>:5005/conversations/default/trigger\_intent. The configuration converts these calls to HTTPS, resulting in a TIME\_OUT\_ERROR.

Here’s the current nginx configuration file:

server { listen 80; listen [::]:80; server\_name \<IP\_ADDRESS\>; location / { return 301 https://$host$request\_uri; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server\_name \<IP\_ADDRESS\>; root /datadrive/rasa\_update/webchat; index index.html chatbot.html frontpage.html; ssl\_certificate “”; ssl\_certificate\_key “\<key\_path\>”; ssl\_session\_cache shared:SSL:1m; ssl\_session\_timeout 10m;

```auto
location / {
    proxy_pass http://<ip_address>:7739; # Use 'http' for non-HTTPS upstream
    proxy_set_header Host $host;
}

```

}

I need assistance in resolving this problem. Any suggestions or alterations to the configuration would be helpful. Thank you.
