Manage vhost aliases
parent
73a68a15b1
commit
596aaefb31
|
@ -1,15 +1,17 @@
|
||||||
|
{% set server_name = [ item.name ] %}
|
||||||
|
{% set aliases = item.aliases if item.aliases is defined else [] %}
|
||||||
|
{% set ignore = server_name.extend(aliases) %}
|
||||||
|
|
||||||
{% if item.ssl is defined and item.ssl.use is defined and item.ssl.use %}
|
{% if item.ssl is defined and item.ssl.use is defined and item.ssl.use %}
|
||||||
listen {{ item.listen | default('443') }};
|
listen {{ item.listen | default('443') }};
|
||||||
# server_name {{ item.name | join(' ')}}; # TODO: gérer plusieurs vhosts
|
server_name {{ server_name | join(' ') }};
|
||||||
server_name {{ item.name }};
|
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate {{ nginx_ssl_dir }}/{{ item.name }}/{{ item.name }}.crt;
|
ssl_certificate {{ nginx_ssl_dir }}/{{ item.name }}/{{ item.name }}.crt;
|
||||||
ssl_certificate_key {{ nginx_ssl_dir }}/{{ item.name }}/{{ item.name }}.key;
|
ssl_certificate_key {{ nginx_ssl_dir }}/{{ item.name }}/{{ item.name }}.key;
|
||||||
include /etc/nginx/helpers/ssl-{{ item.ssl.template | default('strong') }};
|
include /etc/nginx/helpers/ssl-{{ item.ssl.template | default('strong') }};
|
||||||
{% else %}
|
{% else %}
|
||||||
listen {{ item.listen | default('80') }};
|
listen {{ item.listen | default('80') }};
|
||||||
# server_name {{ item.name | join(' ')}}; # TODO: gérer plusieurs vhosts
|
server_name {{ server_name | join(' ') }};
|
||||||
server_name {{ item.name }};
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
root {{ nginx_root }}/{{ item.name }}/public;
|
root {{ nginx_root }}/{{ item.name }}/public;
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
nginx_php: true
|
nginx_php: true
|
||||||
nginx_vhosts:
|
nginx_vhosts:
|
||||||
- name: 'test.local'
|
- name: 'test.local'
|
||||||
|
aliases:
|
||||||
|
- test-alias.local
|
||||||
|
- test2-alias.local
|
||||||
template: 'static'
|
template: 'static'
|
||||||
ssl:
|
ssl:
|
||||||
use: false
|
use: false
|
||||||
|
|
Loading…
Reference in New Issue