Setting up webhooks for connectors with nginx

I would like to setup a webhook for facebook messenger. My nginx config looks like this:

server {
  listen 443 ssl;
  server_name  subdomain.example.com;

  index index.html index.htm;

  ssl_certificate        /path/to/fullchain.pem;
  ssl_certificate_key   /path/to/privkey.pem;

  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on;
  ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';


  location / {
    proxy_pass http://localhost:5005/;  # <-- port where Rasa is running
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_buffering    off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto http;
  }
}

What would be the Callback URL that I should provide in the facebook messenger setup? I have tried https://subdomain.example.com/webhooks/facebook/webhook but it didn’t work.

I can see Hello from Rasa: 2.4.3 when navigating to my site with https.

Did you add facebook to your credentials.yml?

yes

Can you try any other connector like rest? does that work?

Sure. I will try that when I get back home. I’m actually new to nginx so my first assumption was that I did something wrong with the config. I’ll go through some nginx guides as well.

What is the best way to log and examine incoming requests within the rasa server?

consider this for loggin using event brokers @stephens wrote an very interesting post about that

My problem was that I didn’t uncomment the facebook line

#facebook:
    verify: "abcd" 

:man_facepalming:

1 Like