Browse Source

nginx: read server-status values before changing the config

tags/10.1.0^2
Jérémy Lecour 4 months ago
committed by Gitea
parent
commit
c2ae3de929
4 changed files with 26 additions and 20 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +5
    -1
      nginx/tasks/main_regular.yml
  3. +0
    -19
      nginx/tasks/server_status_read.yml
  4. +20
    -0
      nginx/tasks/server_status_write.yml

+ 1
- 0
CHANGELOG.md View File

@@ -31,6 +31,7 @@ The **patch** part changes incrementally at each release.
* packweb-apache: Don't turn on mod-evasive emails by default
* haproxy: chroot and socket path are configurable
* haproxy: adapt backports installed package list to distibution
* nginx: read server-status values before changing the config
* redis: create sudoers file if missing
* redis: new syntax for match filter
* redis: raise an error is port 6379 is used in "instance" mode


+ 5
- 1
nginx/tasks/main_regular.yml View File

@@ -2,6 +2,10 @@

- include: packages.yml

- include: server_status_read.yml
tags:
- nginx

# TODO: find a way to override the main configuration
# without touching the main file

@@ -108,7 +112,7 @@
tags:
- nginx

- include: server_status.yml
- include: server_status_write.yml
tags:
- nginx



nginx/tasks/server_status.yml → nginx/tasks/server_status_read.yml View File

@@ -34,22 +34,3 @@
- debug:
var: nginx_serverstatus_suffix
verbosity: 1

- name: replace server-status suffix in default site index
replace:
dest: /var/www/index.html
regexp: '__SERVERSTATUS_SUFFIX__'
replace: "{{ nginx_serverstatus_suffix }}"

- name: add server-status suffix in default site index if missing
replace:
dest: /var/www/index.html
regexp: '"/nginx_status-?"'
replace: '"/nginx_status-{{ nginx_serverstatus_suffix }}"'

- name: add server-status suffix in default VHost
replace:
dest: /etc/nginx/sites-available/evolinux-default.conf
regexp: 'location /nginx_status-? {'
replace: 'location /nginx_status-{{ nginx_serverstatus_suffix }} {'
notify: reload nginx

+ 20
- 0
nginx/tasks/server_status_write.yml View File

@@ -0,0 +1,20 @@
---

- name: replace server-status suffix in default site index
replace:
dest: /var/www/index.html
regexp: '__SERVERSTATUS_SUFFIX__'
replace: "{{ nginx_serverstatus_suffix }}"

- name: add server-status suffix in default site index if missing
replace:
dest: /var/www/index.html
regexp: '"/nginx_status-?"'
replace: '"/nginx_status-{{ nginx_serverstatus_suffix }}"'

- name: add server-status suffix in default VHost
replace:
dest: /etc/nginx/sites-available/evolinux-default.conf
regexp: 'location /nginx_status-? {'
replace: 'location /nginx_status-{{ nginx_serverstatus_suffix }} {'
notify: reload nginx

Loading…
Cancel
Save