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

Use `default_type` instead of `add_header Content-Type`

The latter can cause duplicate Content-Type headers. Thanks to strcat
for notifying me of the issue.
parent f3be425a
No related branches found
No related tags found
1 merge request!401Use `default_type` instead of `add_header Content-Type`
Pipeline #7771 passed
......@@ -92,12 +92,12 @@ server {
error_page 503 /503.html;
location /.well-known/matrix/server {
add_header Content-Type application/json;
default_type application/json;
return 200 '{"m.server": "{{ matrix_domain }}:443"}';
}
location /.well-known/matrix/client {
add_header Content-Type application/json;
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.homeserver": {"base_url": "https://{{ matrix_domain }}"}, "m.identity_server": {"base_url": "https://matrix.org"} }';
}
......
......@@ -114,12 +114,12 @@ server {
ssl_trusted_certificate /etc/letsencrypt/live/{{ archweb_domain }}/chain.pem;
location /.well-known/matrix/server {
add_header Content-Type application/json;
default_type application/json;
return 200 '{"m.server": "{{ matrix_domain }}:443"}';
}
location /.well-known/matrix/client {
add_header Content-Type application/json;
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.homeserver": {"base_url": "https://{{ matrix_domain }}"}, "m.identity_server": {"base_url": "https://matrix.org"} }';
}
......
......@@ -66,7 +66,7 @@ server {
}
location ~ \.gz$ {
add_header Content-Type text/plain;
default_type text/plain;
add_header Content-Encoding gzip;
expires 5m;
}
......
......@@ -61,13 +61,13 @@ server {
{% endfor %}
location = /metrics {
add_header Content-Type text/plain;
default_type text/plain;
return 200 "Available endpoints:\n{% for ep in matrix_metrics_endpoints %} /metrics/{{ ep.name }}\n{% endfor %}";
}
}
location = / {
add_header Content-Type text/plain;
default_type text/plain;
return 200 "Nothing to see here.";
}
......
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