parent
3e228d0812
commit
4c63efa588
|
@ -16,7 +16,9 @@ sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
|
||||||
language: python
|
language: python
|
||||||
python: 2.7
|
python:
|
||||||
|
- 2.7
|
||||||
|
- 3.6
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
def nginx_site_filename(site):
|
def nginx_site_filename(site):
|
||||||
if site.has_key('filename'):
|
if 'filename' in site:
|
||||||
return site['filename']
|
return site['filename']
|
||||||
else:
|
else:
|
||||||
return nginx_site_name(site)
|
return nginx_site_name(site)
|
||||||
|
@ -14,13 +14,13 @@ def nginx_ssl_dir(pair, ssl_dir):
|
||||||
return ssl_dir + '/' + nginx_site_filename(pair)
|
return ssl_dir + '/' + nginx_site_filename(pair)
|
||||||
|
|
||||||
def nginx_key_path(pair, ssl_dir):
|
def nginx_key_path(pair, ssl_dir):
|
||||||
if pair.has_key('dest_key'):
|
if 'dest_key' in pair:
|
||||||
return pair['dest_key']
|
return pair['dest_key']
|
||||||
else:
|
else:
|
||||||
return nginx_ssl_dir(pair, ssl_dir) + '/' + nginx_site_filename(pair) + '.key'
|
return nginx_ssl_dir(pair, ssl_dir) + '/' + nginx_site_filename(pair) + '.key'
|
||||||
|
|
||||||
def nginx_cert_path(pair, ssl_dir):
|
def nginx_cert_path(pair, ssl_dir):
|
||||||
if pair.has_key('dest_cert'):
|
if 'dest_cert' in pair:
|
||||||
return pair['dest_cert']
|
return pair['dest_cert']
|
||||||
else:
|
else:
|
||||||
return nginx_ssl_dir(pair, ssl_dir) + '/' + nginx_site_filename(pair) + '.crt'
|
return nginx_ssl_dir(pair, ssl_dir) + '/' + nginx_site_filename(pair) + '.crt'
|
||||||
|
@ -32,7 +32,7 @@ def nginx_all_site_names(site):
|
||||||
else:
|
else:
|
||||||
all_sites.append(site['name'])
|
all_sites.append(site['name'])
|
||||||
|
|
||||||
if site.has_key('redirect_from'):
|
if 'redirect_from' in site:
|
||||||
if isinstance(site['redirect_from'], list):
|
if isinstance(site['redirect_from'], list):
|
||||||
all_sites = all_sites + site['redirect_from']
|
all_sites = all_sites + site['redirect_from']
|
||||||
else:
|
else:
|
||||||
|
@ -48,7 +48,7 @@ def nginx_search_by_ssl_name(sites, ssl_name):
|
||||||
|
|
||||||
res = None
|
res = None
|
||||||
for site in sites:
|
for site in sites:
|
||||||
if site.has_key('ssl_name') and site['ssl_name'] == comp_ssl_name:
|
if 'ssl_name' in site and site['ssl_name'] == comp_ssl_name:
|
||||||
res = site
|
res = site
|
||||||
break
|
break
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -118,7 +118,7 @@ server {
|
||||||
|
|
||||||
{% block template_headers %}
|
{% block template_headers %}
|
||||||
# --> Custom headers
|
# --> Custom headers
|
||||||
{% for key, value in __headers.iteritems() %}
|
{% for key, value in __headers.items() %}
|
||||||
add_header {{ key }} "{{ value | regex_replace('\s+always$', '') }}"{% if value | regex_search('\s+always$') %} always{% endif %};
|
add_header {{ key }} "{{ value | regex_replace('\s+always$', '') }}"{% if value | regex_search('\s+always$') %} always{% endif %};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
# <-- Custom headers
|
# <-- Custom headers
|
||||||
|
@ -126,7 +126,7 @@ server {
|
||||||
|
|
||||||
{{ locations(__location_before, __location_order_before) }}
|
{{ locations(__location_before, __location_order_before) }}
|
||||||
|
|
||||||
{% if not __location.has_key('/') %}
|
{% if not '/' in __location %}
|
||||||
location / {
|
location / {
|
||||||
{% block template_try_files %}
|
{% block template_try_files %}
|
||||||
try_files {{ item.override_try_files | default('$uri $uri/ =404') }};
|
try_files {{ item.override_try_files | default('$uri $uri/ =404') }};
|
||||||
|
|
Loading…
Reference in New Issue