T
T
triadecom2019-05-04 15:50:51
Nginx
triadecom, 2019-05-04 15:50:51

How to accept https requests to node, over nginx?

Hello again.
I’m trying to run the callback api from VKontakte on my server, I’m already close to the finish line, but I got up on one problem:
VKontakte requires a server on https with a valid non-self-signed certificate for callback services. I did this, I checked the work on the php script, the server calmly meets the requirements, accepting and giving requests.
But since I am not a php developer, but a node, the first thing I did was launch the node server on port 3000.
But now I don’t know how to process requests from under port 3000 that go to my main nginx server on port 443.
I really like how ngrok works, so I would like to do something similar, but without ngrok itself.
How can this be implemented?
The server itself is on Ubuntu 16.04 + Nginx (php also works from under it) and Node

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mysterion, 2019-05-04
@triadecom

If nginx acts as a proxy server, and nodejs is hidden behind it, then nodejs does not need a certificate.
Just add in the nginx config for the desired location:
proxy_pass http://127.0.0.1:3000;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question