A
A
ALXTNTCN2021-03-08 14:22:16
Nginx
ALXTNTCN, 2021-03-08 14:22:16

How to make ssl for a different port on the server?

Hello! I am using VDS Ubuntu 20.04. I have a domain like https://site.com . it has an ssl certificate Certbot from LetsEncrypt installed on it. I need another service to run on a different port. For example, so that it opens https://site.com:1337 . The problem is that it opens on http, but doesn't want to on https. I use nginx on the server
Help pliz how to solve the problem how to set it up
why ssl does not work on other ports?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2021-03-08
@ALXTNTCN

In nginx.conf:

server {
listen *:1337 ssl;
server_name site.com;
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.com/private.pem;
#.........
}

To the browser https://site.com:1337/ , and alga!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question