Answer the question
In order to leave comments, you need to log in
How to register 2 ssl paths for two domains in the 1st nginx config?
Is it possible to prescribe different paths in one configuration file, for the main domain one path for another subdomain another path? Both domains work in conjunction and give out different content at the php level, so they are configured in one file.
Now the config is
server {
listen ip:443;
server_name site.ru www.site.ru sub.site.ru;
root /home/maxmarket/web/site.ru/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/site.ru.log combined;
access_log /var/log/nginx/domains/site.ru.bytes bytes;
error_log /var/log/nginx/domains/site.ru.error.log error;
ssl on;
ssl_certificate /home/maxmarket/conf/web/ssl.site.ru.pem;
ssl_certificate_key /home/maxmarket/conf/web/ssl.site.ru.key;
Answer the question
In order to leave comments, you need to log in
server_name
operates within the block server
. Accordingly, even if the certificate is issued for both the main domain and the subdomain (which is generally wrong), the processing rules must be in different blocks (unless, of course, they are similar - then you can simply server_name
specify both names).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question