Я настраиваю прокси с помощью nginx. Представьте, что я хочу добавить связку имя_сервера в ту же конфигурацию:
server {
listen 1.2.3.4:443 ssl;
server_name 1.abc.org;
access_log off;
error_log off;
ssl_certificate /etc/nginx/ssl/test.crt;
ssl_certificate_key /etc/nginx/ssl/test.key;
keepalive_timeout 60;
location / {
proxy_pass https://1.abc.org;
include /etc/nginx/conf.d/proxy.conf;
proxy_set_header X-Forwarded-Proto https;
}
}
Я хочу добавить связку имя_сервера:
должно быть
server {
listen 1.2.3.4:443 ssl;
server_name $server_name;
access_log off;
error_log off;
ssl_certificate /etc/nginx/ssl/test.crt;
ssl_certificate_key /etc/nginx/ssl/test.key;
keepalive_timeout 60;
location / {
proxy_pass https://$server_name;
include /etc/nginx/conf.d/proxy.conf;
proxy_set_header X-Forwarded-Proto https;
}
}
и
имя_сервера = 1.abc.org, 2.abc.org, 3.abc.org, 4.abc.org, aish.abc.org ...
тогда я могу сделать более простую работу, добавив имя_сервера, как в строке выше, не нужно копировать блок конфигурации. Как я могу это сделать?
Спасибо.