question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to enable https on rasa core server

See original GitHub issue

Rasa Core version: 0.12.3 Python version: 3.6.7 Operating system (windows, osx, …): windows 7 64 bit

Issue:

Hey guys! So my bot is running on AWS and i’m getting the reply in my browser. But it’s a “http” i.e. it’s not secure port. I need secure port to run with my web app. Whenever I enable the SSL on port 5005 and try to run the bot it gives error and says,

File “/home/ubuntu/.local/lib/python3.6/site-packages/gevent/server.py”, line 256,│

in _tcp_listener │ sock.bind(address) │

OSError: [Errno 98] Address already in use: (‘0.0.0.0’, 5005)

Now when I disable my SSL and run the bot, It runs easily and replies on http call. So how can I convert this http to https? Any help is appreciated.

Content of domain file (if used & relevant):


Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
bikashkumarscommented, Dec 31, 2018

Your Rasa Core should be up and running on default port 5005 (If you are not dealing with specific requirement). So first check, you able to hit rasa core from postman or not. If that is ok.

Regarding Apache, you may follow this. Apache In Ubuntu Make sure Apache is listening on port 80 and 443.

Make sure you have followed these steps to make reverse proxy work.

#Enable SSL module of Apache $ sudo a2enmod ssl $ service apache2 reload $ service apache2 restart

#Install Certificate Create a directory called “certificates” at this location (or anything of your choice) $cd /etc/apache2/certificates Upload your certificate and private key to above location certificate.csr and certificate.key

$ cd /etc/apache2/sites-available $ vim default-ssl.conf

Add these contents to make your Apache HTTPs enabled

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName domain-name.com
        DocumentRoot /var/www/html
         
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
         
        SSLEngine on
 
        SSLCertificateFile  /etc/apache2/certificates/certificate.cer
        SSLCertificateKeyFile  /etc/apache2/certificates/certificate.key
    </VirtualHost>
</IfModule>

#start $ service apache2 reload $ service apache2 restart

So now you should about to access your localhost in browser https://your-domain-name/

Make sure Apache Default page is coming over https

Now you need to do proxy forwarding to Rasa to port 5005

$ cd /etc/apache2/sites-available $ vim default-ssl.conf

Now you need to tell apache , to redirect all traffic to http/5005 port. that’s it.

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName domain-name.com
        DocumentRoot /var/www/html
         
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
         
        SSLEngine on
 
        SSLCertificateFile  **/etc/apache2/certificates/certificate.cer**
        SSLCertificateKeyFile  **/etc/apache2/certificates/certificate.key**
 
                ProxyRequests     Off
                ProxyPreserveHost On
                ProxyPass /rasa/  http://localhost:5005/ nocanon
                ProxyPassReverse  /rasa/  http://localhost:5005
                
                AllowEncodedSlashes NoDecode
                RequestHeader set X-Forwarded-Proto "https"
                RequestHeader set X-Forwarded-Port "443"
                RedirectPermanent /rasa
     
                <Location http://localhost:5005/rasa*>
                   Order deny,allow
                   Allow from all
                </Location>
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                        SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                        SSLOptions +StdEnvVars
                </Directory>
    </VirtualHost>
</IfModule>

#start $ service apache2 reload $ service apache2 restart

Now check https://your-domain-name/rasa/ and send some POSt request with body. It should be working

2reactions
bikashkumarscommented, Dec 31, 2018

Hi,

You need to use Proxy approach to solve this. In your AWS, install Apache Web Server or Nginx. Then Install your self-signed or CA signed certificate on Apache or Nginx. Then redirect traffic to Rasa.

Browser/Client -> https AWS -> AWS Apache -> Proxy forward to rasa over http -> rasa http

If you need more info on how to do it, reply back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable SSL for Rasa core server
My site hosted in wamp server with the proper SSL certificate is installed. From my site i am calling the rasa core HTTP...
Read more >
Create Chatbot using Rasa Part-1 - Towards Data Science
Rasa is an open source machine learning framework for building AI assistants and chatbots. Mostly you don't need any programming language experience to...
Read more >
Set up PPM Chatbot - ADM Help Centers
Set up Rasa server · Obtain the VM image from the PPM marketplace. · Start the VM using the following account. Username: admin....
Read more >
How to set up HTTPS for Rasa chatbot? - Stack Overflow
Chatbot engine: Rasa 2.2 in docker 20.10.6 container. Chatbot widget: Botfront webchat 0.11.12. Web server: Nginx 1.14.0
Read more >
Virtual Assistant (with Rasa) — NVIDIA Riva Speech Skills v1 ...
Start the Riva Speech Server. Follow the steps in the Quick Start Guide. · Start the Rasa Action server. Run the Riva Sample...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found