瀏覽代碼

Merge pull request #234 from ugs9fsy71cb/master

Serve nginx_status to matrix.DOMAIN
pull/239/head
Slavi Pantaleev 6 年之前
committed by GitHub
父節點
當前提交
4abca27df7
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 4 個檔案被更改,包括 41 行新增0 行删除
  1. +23
    -0
      docs/configuring-playbook-ngnix.md
  2. +2
    -0
      docs/configuring-playbook.md
  3. +5
    -0
      roles/matrix-nginx-proxy/defaults/main.yml
  4. +11
    -0
      roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2

+ 23
- 0
docs/configuring-playbook-ngnix.md 查看文件

@@ -0,0 +1,23 @@
# Configure Ngnix (optional, advanced)

By default, this playbook installs its own nginx webserver (in a Docker container) which listens on ports 80 and 443.
If that's alright, you can skip this.


## Using Ngnix status

This will serve a statuspage to the hosting machine only. Useful for monitoring software like [longview](https://www.linode.com/docs/platform/longview/longview-app-for-nginx/)

```yaml
matrix_nginx_proxy_proxy_matrix_nginx_status_enabled: true
```

This will serve the status page under ```https://matrix.DOMAIN/nginx_status```

By default, if ```matrix_nginx_proxy_nginx_status_enabled``` is enabled, access to the status page would be allowed from the local IP address of the server. If you wish to allow access from other IP addresses, you can provide them as a list:

```yaml
matrix_nginx_proxy_proxy_matrix_nginx_status_allowed_addresses:
- 8.8.8.8
- 1.1.1.1
```

+ 2
- 0
docs/configuring-playbook.md 查看文件

@@ -44,6 +44,8 @@ When you're done with all the configuration you'd like to do, continue with [Ins

- [Serving your base domain using this playbook's nginx server](configuring-playbook-base-domain-serving.md) (optional)

- [Configure Ngnix (optional, advanced)](configuring-playbook-ngnix.md) (optional, advanced)

- [Using your own webserver, instead of this playbook's nginx proxy](configuring-playbook-own-webserver.md) (optional, advanced)

- [Adjusting TURN server configuration](configuring-playbook-turn.md) (optional, advanced)


+ 5
- 0
roles/matrix-nginx-proxy/defaults/main.yml 查看文件

@@ -152,3 +152,8 @@ matrix_ssl_lets_encrypt_support_email: ~
matrix_ssl_base_path: "{{ matrix_base_data_path }}/ssl"
matrix_ssl_config_dir_path: "{{ matrix_ssl_base_path }}/config"
matrix_ssl_log_dir_path: "{{ matrix_ssl_base_path }}/log"


# ngnix status page configurations.
matrix_nginx_proxy_proxy_matrix_nginx_status_enabled: false
matrix_nginx_proxy_proxy_matrix_nginx_status_allowed_addresses: ['{{ ansible_default_ipv4.address }}']

+ 11
- 0
roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2 查看文件

@@ -17,6 +17,17 @@ server {
{% endif %}
}

{% if matrix_nginx_proxy_proxy_matrix_nginx_status_enabled %}
location /nginx_status {
stub_status on;
access_log off;
{% for address in matrix_nginx_proxy_proxy_matrix_nginx_status_allowed_addresses %}
allow {{ address }};
{% endfor %}
deny all;
}
{% endif %}

location / {
return 301 https://$http_host$request_uri;
}


Loading…
取消
儲存