Skip to content
Snippets Groups Projects
Verified Commit 43b89a05 authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

matrix: Route event reports to mjolnir

parent be5399db
No related branches found
No related tags found
No related merge requests found
Pipeline #13182 passed
......@@ -2,6 +2,12 @@
matrix_max_upload_size: 50M
matrix_nginx_config:
- name: mjolnir
port: 8010
locations:
- path: "~ ^/_matrix/client/r0/rooms/([^/]*)/report/(.*)$"
pass: "/api/1/report/$1/$2"
add_cors: true
- name: federation_reader
port: 8011
locations:
......
......@@ -167,7 +167,7 @@ health:
# Options for exposing web APIs.
web:
# Whether to enable web APIs.
enabled: false
enabled: true
# The port to expose the webserver on. Defaults to 8080.
port: 8010
......
......@@ -37,10 +37,18 @@ server {
{% for config in matrix_nginx_config %}
# {{ config.name }}
{% for location in config.locations %}
location {{ location }} {
{% if location is string %}
{% set location = { 'path': location } %}
{% endif %}
location {{ location.path }} {
access_log /var/log/nginx/{{ matrix_domain }}/access.log main;
access_log /var/log/nginx/{{ matrix_domain }}/access.log.json json_main;
proxy_pass http://matrix_{{ config.name }};
{% if location.add_cors | default(false) %}
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, HEAD, POST, PUT, DELETE, OPTIONS";
add_header Access-Control-Allow-Headers "X-Requested-With, Content-Type, Authorization, Date";
{% endif %}
proxy_pass http://matrix_{{ config.name }}{{ location.pass | default('') }};
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment