Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question