Update 'etc/nginx/sites-available/matrix.envs.net.conf'

cleanup not needed additional locations and optimize config
This commit is contained in:
creme 2021-08-01 13:09:52 +00:00
parent 817cd40f4c
commit 6025623cc2

View File

@ -1,7 +1,7 @@
server {
listen 80 default_server;
#listen [::]:80;
server_name matrix.envs.net;
server_name matrix.envs.net turn.envs.net;
location / {
return 307 https://$host$request_uri;
@ -11,19 +11,6 @@ server {
alias /var/lib/letsencrypt/.well-known/acme-challenge/;
}
}
server {
listen 80;
#listen [::]:80;
server_name turn.envs.net;
location / {
return 307 https://matrix.envs.net$request_uri;
}
location /.well-known/acme-challenge/ {
alias /var/lib/letsencrypt/.well-known/acme-challenge/;
}
}
map $http_origin $DO_CORS {
@ -73,7 +60,7 @@ server {
location /.well-known/matrix/ {
add_header Access-Control-Allow-Origin "$DO_CORS";
add_header Content-Type application/json;
return 200 '{"m.server": "matrix.envs.net:443", "m.homeserver": {"base_url": "https://matrix.envs.net"}, "m.integrations": {"managers": [{"ui_url": "https://dimension.envs.net/riot", "api_url": "https://dimension.envs.net/api/v1/scalar"}, {"ui_url": "https://scalar.vector.im/", "api_url": "https://scalar.vector.im/api"}]}, "m.integrations_widget": {"url": "https://dimension.envs.net/riot", "data": {"api_url": "https://dimension.envs.net/api/v1/scalar"}}}';
return 200 '{"m.server": "matrix.envs.net:443", "m.homeserver": {"base_url": "https://matrix.envs.net"}}';
}
## workers
@ -99,43 +86,9 @@ server {
proxy_read_timeout 3600;
}
## appservice-irc
location ^~ /_matrix/provision {
allow 127.0.0.1;
deny all;
proxy_pass http://localhost:9999/_matrix/provision;
include include.d/synapse-proxy.conf;
}
## MAUBOT
location ^~ /_matrix/maubot {
proxy_pass http://localhost:29316/_matrix/maubot;
include include.d/synapse-proxy.conf;
}
# log
location ^~ /_matrix/maubot/v1/logs {
proxy_pass http://localhost:29316/_matrix/maubot/v1/logs;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
include include.d/synapse-proxy.conf;
}
##
location / {
proxy_pass http://localhost:8008;
include include.d/synapse-proxy.conf;
}
}
server {
listen 8448 ssl http2;
server_name matrix.envs.net;
include snippets/ssl.conf;
location / {
proxy_pass http://localhost:8008;
include include.d/synapse-proxy.conf;
}
}