# How to make rasa webchat work with nginx and https

**URL:** https://forum.rasa.com/t/how-to-make-rasa-webchat-work-with-nginx-and-https/60277
**Category:** Rasa Open Source
**Created:** [November 20, 2023, 11:45am UTC](https://forum.rasa.com/t/how-to-make-rasa-webchat-work-with-nginx-and-https/60277 "2023-11-20T11:45:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yazhini\_23](https://avatars.discourse-cdn.com/v4/letter/y/22d042/32.png) [@yazhini\_23](https://forum.rasa.com/u/yazhini_23)
#### Post date: [November 20, 2023, 11:45am UTC](https://forum.rasa.com/t/how-to-make-rasa-webchat-work-with-nginx-and-https/60277/1 "2023-11-20T11:45:55Z")

</div>

Hi, When I connect my Rasa chatbot to MS Teams through ngrok, it functions perfectly. However, when I switch to using nginx, although the rasa chat widget works well, it fails to appear over HTTPS. Consequently, I’m unable to integrate it with Teams.

 ![chatbot.html](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/a/9/a99f91143c710badce4f63092984ba3550796ec3.png)

 ![credentials](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/7/a/7a5507f5558c513e3685413ea6987f00dfa5d773.png)

 ![nginx.conf](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/8/c/8cfcf7b8df28e669e9739e8de05a2c7fe2abf157.png)

 ![actions Docker file](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/9/f/9f02d8479f656a473ff0a384e8790661d2a4fabd.png)

 ![rasa docker file](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/b/2/b20f74f5516a7594371fd66dd92e591d48fbacfe.png)

---

<div class="post-metadata">

### Author: ![Grace99](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Grace99](https://forum.rasa.com/u/Grace99)
#### Post date: [May 8, 2025, 10:00am UTC](https://forum.rasa.com/t/how-to-make-rasa-webchat-work-with-nginx-and-https/60277/2 "2025-05-08T10:00:03Z")

</div>

To make **Rasa Webchat** work with **NGINX** and **HTTPS** , you need to configure several parts correctly:

### Steps Overview:

1. **Set up your Rasa server**

2. **Enable CORS and set credentials in `endpoints.yml`**

3. **Serve your webchat widget**

4. **Use HTTPS with a domain (via NGINX + SSL certificate)**

5. **Configure NGINX properly**

6. Rasa Server Configuration

Edit your `endpoints.yml` to allow connections from your frontend (e.g., your domain):

```yaml
cors:
  origin: "https://yourdomain.com"

```

Ensure `credentials.yml` has the REST channel enabled:

```yaml
rest:

```

* * *

1. Use Rasa Webchat

Serve the widget in your HTML:

```html
<script src="https://cdn.jsdelivr.net/npm/rasa-webchat@1.0.1/lib/index.min.js"></script>
<div id="webchat" />
<script>
  WebChat.default({
    initPayload: "/greet",
    customData: {"language": "en"}, // optional
    socketUrl: "https://yourdomain.com",
    title: "Rasa Bot",
    subtitle: "Chat with me!",
  }, null);
</script>

```

Change `socketUrl` to your secure Rasa server URL.

* * *

1. Set Up HTTPS with NGINX

Example NGINX config with SSL:

Install SSL, then use a config like this:

```nginx
server {
    listen 80;
    server_name yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:5005; # Rasa running locally
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}

```

Make sure Rasa is running with `--cors "*" --enable-api`.

* * *

You can refer this guide for detailed information : [install SSL Certificate on NGINX](https://www.ssl2buy.com/wiki/how-to-install-ssl-certificate-on-nginx-server)

Run Rasa server securely

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

```

* * *

Test the Setup

1. Visit `https://yourdomain.com` in your browser.
2. Check if the Rasa Webchat widget loads and can chat with the bot.

* * *

Hope its clear now.
