how to redirect https requests to specific port

by Niko Gamulin   Last Updated October 09, 2019 18:00 PM

I have create a node.js application that communicates with facebook messenger and runs on aws.

For https, I use nginx; the configuration I use now is the following:

server {
     listen 443 ssl;
     ssl_certificate /etc/letsencrypt/live/;
     ssl_certificate_key /etc/letsencrypt/live/;
     location / {
       proxy_set_header  X-Real-IP  $remote_addr;
       proxy_set_header  Host       $http_host;

The node.js app runs on port 3000 and right now I use ngrok to forward https requests to port 3000. I would like to turn off ngrok and appropriately configure nginx.

Facebook messenger makes a post request to the address that is configured as follows: enter image description here

I tried to change the ngrok address with and https://[IP address]/webhook but none of it worked.

Does anyone know what is the right way to forward https requests to specific ports?

Tags : nginx ssl

Related Questions

Updated September 16, 2019 18:00 PM

Updated August 03, 2019 14:00 PM

Updated March 27, 2015 07:00 AM

Updated March 26, 2015 14:00 PM