A
A
artyak11212020-01-09 19:18:23
Nginx
artyak1121, 2020-01-09 19:18:23

Proper HTTPS setup?

Good day. There is the following problem, configured SSL from let's encrypt, everything is fine. But my site works on a bunch of nginx + laravel + nodejs, and so the node accesses the site by IP address. And the site cannot be contacted, because if I go to the IP address, I get a line saying: "The server cannot confirm the connection with the domain 127.0.0.1 Its security certificate has been issued for the test.ru domain" how can I configure it correctly https, so that if you go to the IP address there is no redirect to https?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vreitech, 2020-01-09
@fzfx

CAs don't issue certificates to IP addresses, so you should either go by domain name or HTTP instead of HTTPS (and disable the HTTP to HTTPS redirect on incoming connections by IP address, if any), or issue a self-signed one yourself. certificate for the IP address and make it trusted by node.

V
Vasya Pupkin, 2020-01-09
@Desert-Eagle

The stars tell me that without an example of your config, there is not much to help here.

A
Alexey Dmitriev, 2020-01-09
@SignFinder

Slightly confusing description.
The certificate is issued in the name or wildcard. It must be at the input, that is, it must be configured for nginx.
Accordingly, you must have encryption between the browser and nginx when you enter a domain name in the address bar - and there should not be any 127.0.0.1 - all other interaction takes place inside.
The nginx call to nodejs, which is visible and occurs through loopback 127.0.0.1, does not have to be through https - it's better to do it through http - why do you need encrypted traffic inside the server.
So in the nginx config in the location that proxies to nodejs, you need to set http://127.0.0.1:xxxx, not http s

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question