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:
|
custom:
|
||||||
- return 301 https://$host$request_uri
|
- return 301 https://$host$request_uri
|
||||||
|
|
||||||
|
nginx_proxy_location:
|
||||||
|
match: /
|
||||||
|
backend: ~
|
||||||
|
|
||||||
phpinidefault:
|
phpinidefault:
|
||||||
post_max_size: 64M
|
post_max_size: 64M
|
||||||
upload_max_filesize: 64M
|
upload_max_filesize: 64M
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
{% set vhost = {}|combine(nginx_vhosts_defaults, item.value, recursive=True) %}
|
{% set vhost = {}|combine(nginx_vhosts_defaults, item.value, recursive=True) %}
|
||||||
{% set vhost_name = item.key %}
|
{% set vhost_name = item.key %}
|
||||||
{% set vhost_headers = {}|combine(nginx.add_headers, vhost.add_headers) %}
|
{% 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) %}
|
{% macro nginx_listen(ips, port, options) %}
|
||||||
{% for ip in ips %}
|
{% for ip in ips %}
|
||||||
|
|
@ -38,9 +39,13 @@ server {
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
{% if vhost.backend %}
|
{% for location in ( vhost.locations + vhost_proxy_location ) %}
|
||||||
location / {
|
location {{ location.match }} {
|
||||||
proxy_pass {{ vhost.backend }};
|
{% if "alias" in location %}
|
||||||
|
alias {{ location.alias }};
|
||||||
|
{% endif %}
|
||||||
|
{% if location.backend|d(False) %}
|
||||||
|
proxy_pass {{ location.backend }};
|
||||||
|
|
||||||
# add proxy headers
|
# add proxy headers
|
||||||
proxy_set_header Host {{ vhost.host }};
|
proxy_set_header Host {{ vhost.host }};
|
||||||
|
|
@ -72,13 +77,6 @@ server {
|
||||||
|
|
||||||
# no double headers
|
# no double headers
|
||||||
proxy_hide_header Strict-Transport-Security;
|
proxy_hide_header Strict-Transport-Security;
|
||||||
}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for location in vhost.locations %}
|
|
||||||
location {{ location.match }} {
|
|
||||||
{% if "alias" in location %}
|
|
||||||
alias {{ location.alias }};
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for c in location.custom|default([]) %}
|
{% for c in location.custom|default([]) %}
|
||||||
{{ c }};
|
{{ c }};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue