瀏覽代碼

nginx and certificate config

master
父節點
當前提交
aca026f39b
共有 3 個檔案被更改,包括 40 行新增0 行删除
  1. +1
    -0
      defaults/main.yaml
  2. +18
    -0
      tasks/main.yaml
  3. +21
    -0
      vars/main.yaml

+ 1
- 0
defaults/main.yaml 查看文件

@@ -1 +1,2 @@
---
alerta_server_name: "{{ inventory_hostname }}"

+ 18
- 0
tasks/main.yaml 查看文件

@@ -81,3 +81,21 @@
content: from alerta import app
dest: /opt/alerta/wsgi.py
notify: restart uwsgi

- include_role:
name: certificate
vars:
certificate_name: alerta
certificate_directory: /etc/ssl
certificate_key_usage:
- digitalSignature
- keyEncipherment
certificate_extended_key_usage:
- serverAuth
certificate_alt_names:
- "{{ alerta_server_name | regex_replace( '(.*)','DNS:\\1' ) }}"

- include_role:
name: nginx
vars:
nginx_vhosts: "{{ alerta_nginx_vhosts }}"

+ 21
- 0
vars/main.yaml 查看文件

@@ -15,3 +15,24 @@ alerta_uwsgi_config:

alerta_webui_config:
endpoint: /api

alerta_nginx_vhosts:
- name: alerta
server_names:
- "{{ alerta_server_name }}"
custom: |-
root /opt/alerta/webui/dist;
index index.html;

location /api { try_files $uri @api; }
location @api {
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/app/alerta/socket;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /config.json { alias /opt/alerta/config.json; }
location / {
try_files $uri $uri/ /index.html;
}

Loading…
取消
儲存