bundles/nginx: use metadata reactor to determine index files
This commit is contained in:
parent
3ee570a47a
commit
e2d8923dee
4 changed files with 30 additions and 6 deletions
|
@ -46,3 +46,27 @@ def letsencrypt(metadata):
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor
|
||||
def index_files(metadata):
|
||||
vhosts = {}
|
||||
|
||||
for vhost, config in metadata.get('nginx/vhosts', {}).items():
|
||||
vhosts[vhost] = {
|
||||
'index': [
|
||||
'index.html',
|
||||
'index.htm',
|
||||
],
|
||||
}
|
||||
|
||||
if config.get('php', False):
|
||||
# If we're using PHP, make sure index.php is tried first
|
||||
vhosts[vhost]['index'].insert(0, 'index.php')
|
||||
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': vhosts,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue