Merge branch 'master' of ssh://git-ssh.notandy.de:2222/ansible/roles/nginx
This commit is contained in:
commit
2032a428a4
2 changed files with 12 additions and 10 deletions
|
|
@ -64,6 +64,10 @@ nginx_forcessl_vhost:
|
|||
custom:
|
||||
- return 301 https://$host$request_uri
|
||||
|
||||
nginx_proxy_location:
|
||||
match: /
|
||||
backend: ~
|
||||
|
||||
phpinidefault:
|
||||
post_max_size: 64M
|
||||
upload_max_filesize: 64M
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
{% set vhost = {}|combine(nginx_vhosts_defaults, item.value, recursive=True) %}
|
||||
{% set vhost_name = item.key %}
|
||||
{% set vhost_headers = {}|combine(nginx.add_headers, vhost.add_headers) %}
|
||||
{% set vhost_proxy_location = [ {}|combine(nginx_proxy_location, {'backend': vhost.backend }) ] if vhost.backend|d(False) else [] %}
|
||||
|
||||
{% macro nginx_listen(ips, port, options) %}
|
||||
{% for ip in ips %}
|
||||
|
|
@ -38,9 +39,13 @@ server {
|
|||
{% endfor %}
|
||||
|
||||
|
||||
{% if vhost.backend %}
|
||||
location / {
|
||||
proxy_pass {{ vhost.backend }};
|
||||
{% for location in ( vhost.locations + vhost_proxy_location ) %}
|
||||
location {{ location.match }} {
|
||||
{% if "alias" in location %}
|
||||
alias {{ location.alias }};
|
||||
{% endif %}
|
||||
{% if location.backend|d(False) %}
|
||||
proxy_pass {{ location.backend }};
|
||||
|
||||
# add proxy headers
|
||||
proxy_set_header Host {{ vhost.host }};
|
||||
|
|
@ -72,13 +77,6 @@ server {
|
|||
|
||||
# no double headers
|
||||
proxy_hide_header Strict-Transport-Security;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% for location in vhost.locations %}
|
||||
location {{ location.match }} {
|
||||
{% if "alias" in location %}
|
||||
alias {{ location.alias }};
|
||||
{% endif %}
|
||||
{% for c in location.custom|default([]) %}
|
||||
{{ c }};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue