mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Fix deprecations (#35)
* Drop Nagios support * Fix start PHP-FPM on Docker * Fix deprecations on Ansible 2.7 - with_ -> loop - fix filters as test - test version_compare -> version - set min_version to 2.5
This commit is contained in:
@@ -83,7 +83,7 @@ server {
|
||||
{% block template_headers %}
|
||||
# --> Custom headers
|
||||
{% for key, value in __headers.iteritems() %}
|
||||
add_header {{ key }} "{{ value | replace(' always', '') }}"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||
add_header {{ key }} "{{ value | replace(' always', '') }}"{% if nginx_version.stdout is version('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||
{% endfor %}
|
||||
# <-- Custom headers
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
{% extends "_php.j2" %}
|
||||
|
||||
{% block root %}
|
||||
root {{ nginx_nagios_root }};
|
||||
{% endblock %}
|
||||
|
||||
{% block template_try_files %}
|
||||
{% endblock %}
|
||||
|
||||
{% block template_index %}
|
||||
index index.php index.html;
|
||||
{% endblock %}
|
||||
|
||||
{% block template_headers %}
|
||||
# --> Custom headers
|
||||
{% for key, value in __headers.iteritems() %}
|
||||
{% if key == "X-Frame-Options" %}
|
||||
# X-Frame-Options forced by Ansible
|
||||
add_header {{ key }} "SAMEORIGIN"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') %} always{% endif %};
|
||||
{% else %}
|
||||
add_header {{ key }} "{{ value | replace(' always', '') }}"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
# <-- Custom headers
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block template_local_content %}
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location /stylesheets {
|
||||
{% if nginx_nagios_stylesheets is defined %}
|
||||
alias {{ nginx_nagios_stylesheets }};
|
||||
{% endif %}
|
||||
expires 60d;
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block template_upstream_location %}
|
||||
{% if ansible_distribution == 'Debian' %}
|
||||
location /cgi-bin/nagios3 {
|
||||
root /usr/lib;
|
||||
{% elif ansible_distribution == 'FreeBSD' %}
|
||||
location /cgi-bin {
|
||||
{% endif %}
|
||||
try_files $uri =404;
|
||||
include fastcgi.conf;
|
||||
fastcgi_pass unix:{{ nginx_fcgiwrap_sock }};
|
||||
fastcgi_param AUTH_USER $remote_user;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass {{ php_upstream }};
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user