P
P
Pavel2022-01-28 11:11:25
Nginx
Pavel, 2022-01-28 11:11:25

How to catch multiple https requests with nginx?

I have several servers, one of them has nginx that proxies requests to other servers, it also has all ssl certificates, I ran into a problem out of ignorance
when I type the path https://mysite.com/ by default port 443 is used , which in the configs that auto-generates certbot writes like this

listen [::] 443 ssl ...
listen 443 ...

everything is good and the first site opens

on another site in the same way, but if I want to knock on the server on port 8007 (this is a proxmox backup server) it works on this port by default, then I write in the config
server {
listen 8007;

and in the address bar I type https://mysite.com:8007/
but it doesn't work, why?
and it's not at all clear how to send people to the same port 443 to different sites, maybe it works without ssl, but not with ssl?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-01-28
@mrusklon

You need to add ssl:

server {
listen 8007 ssl;

and it's not at all clear how to send people to the same port 443 to different sites

You need to make several server sections, several virtual hosts in Apache terminology, if you like.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question