A
A
Anatoly2017-10-18 20:43:27
Nginx
Anatoly, 2017-10-18 20:43:27

How to set default server for 443/ssl port in Nginx?

If I specify like this:
server {
listen 80 default;
listen 443 default;
server_name_;
location / {
return 444;
}
}
server {
listen 80;
server_name mysite.ru;
return 302 https://$http_host$request_uri;
}
server {
listen 443 ssl;
server_name mysite.ru;
.....
then ssl does not work on my server at all, writes: "I can not access the site."
If "listen 443 default;" for commenting, then everything works, but the default server is not assigned.
Everything is fine with the 80th port, there are no questions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@ibKpoxa, 2017-10-31
_

listen 443 default;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question