A
A
Alexander Florenko2019-06-25 21:02:39
Nginx
Alexander Florenko, 2019-06-25 21:02:39

How to set up two node servers on nginx (https)?

Hello.
I will say right away, I am a front-end developer, and such a disaster fell on my shoulders)
There is an application on vue + node
Vue works on one node server, since ssr
config is here
And api on the node
Config is here
All this works on a VPS server.
Installed nginx and https certificate from certbot.eff.org
nginx config here
The application works on vue.
But there is no access to the api.

Request URL: https://domain.od.ua:3001/api/v1/admin/login
Referrer Policy: no-referrer-when-downgrade
Provisional headers are shown
Access-Control-Request-Headers: content-type,x-requested-with
Access-Control-Request-Method: POST
Origin: https://domain.od.ua
Referer: https://domain.od.ua/admin-panel/login
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

And in the inspection such an error ERR_SSL_PROTOCOL_ERROR
What did I do wrong?
And how can the problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2019-06-25
@SagePtr

And what prevents you from contacting through nginx, which hangs in front of the node and provides SSL?
Wang that the backend hanging on your port 3001 listens on the HTTP protocol, not HTTPS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question