Answer the question
In order to leave comments, you need to log in
How to make HTTP Basic Auth for one virtual host in Nginx SSL?
Can you tell me how to make https in nginx only for one virtual host?
Now I have the following:
http {
ssl_session_cache shared:SSL:10m;
server {
server_name srv1.example.com
listen 80;
listen 443 ssl;
}
server {
server_name srv2.example.com
listen 80;
location / {
auth_basic "Test closed site";
auth_basic_user_file conf.d/htpasswd;
}
}
}
Answer the question
In order to leave comments, you need to log in
Read here nginx.org/en/docs/http/configuring_https_servers.h... namely, the section about SNI.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question