1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jitsi_ynh.git synced 2024-09-03 19:35:57 +02:00
jitsi_ynh/conf/nginx.conf

99 lines
2.4 KiB
Nginx Configuration File
Raw Normal View History

2024-01-09 19:10:09 +01:00
root __INSTALL_DIR__/jitsi-meet-web;
2019-06-06 06:04:22 +02:00
# fix https://github.com/YunoHost-Apps/jitsi_ynh/issues/113
more_set_headers "Content-Security-Policy: frame-ancestors 'self'";
2020-04-10 05:21:33 +02:00
# ssi on with javascript for multidomain variables in config.js
ssi on;
ssi_types application/x-javascript application/javascript;
2019-06-06 06:04:22 +02:00
2020-04-10 05:21:33 +02:00
index index.html index.htm;
error_page 404 /static/404.html;
location = /config.js {
2020-04-15 08:50:39 +02:00
alias /etc/__NAME__/meet/__DOMAIN__-config.js;
2015-01-14 10:55:14 +01:00
}
2020-04-10 05:21:33 +02:00
location = /external_api.js {
2024-01-09 19:10:09 +01:00
alias __INSTALL_DIR__/jitsi-meet-web/libs/external_api.min.js;
2020-04-10 05:21:33 +02:00
}
2022-02-13 16:40:34 +01:00
# ensure all static content can always be found first
2020-04-10 05:21:33 +02:00
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
{
2022-02-06 15:39:34 +01:00
more_set_headers "Access-Control-Allow-Origin: *";
2024-01-09 19:10:09 +01:00
alias __INSTALL_DIR__/jitsi-meet-web/$1/$2;
2022-02-03 03:00:20 +01:00
# cache all versioned files
if ($arg_v) {
expires 1y;
}
2019-07-13 22:03:01 +02:00
}
2019-07-14 01:17:46 +02:00
# BOSH
2020-04-10 05:21:33 +02:00
location = /http-bind {
2022-02-13 16:40:34 +01:00
proxy_pass http://127.0.0.1:5280/http-bind?prefix=$prefix&$args;
2015-01-14 10:55:14 +01:00
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
2015-01-14 10:55:14 +01:00
}
2019-07-14 01:17:46 +02:00
# xmpp websockets
2020-04-10 05:21:33 +02:00
location = /xmpp-websocket {
2022-02-03 03:00:20 +01:00
proxy_pass http://127.0.0.1:5280/xmpp-websocket?prefix=$prefix&$args;
2019-07-14 01:17:46 +02:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
2019-07-14 01:17:46 +02:00
tcp_nodelay on;
}
2020-04-10 05:21:33 +02:00
2022-02-03 03:00:20 +01:00
# colibri (JVB) websockets for jvb1
location ~ ^/colibri-ws/default-id/(.*) {
proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
2020-04-10 05:21:33 +02:00
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
location @root_path {
rewrite ^/(.*)$ / break;
}
location ~ ^/([^/?&:'"]+)/config.js$
{
2022-02-13 16:40:34 +01:00
set $subdomain "$1.";
set $subdir "$1/";
alias /etc/__NAME__/meet/__DOMAIN__-config.js;
2020-04-10 05:21:33 +02:00
}
# BOSH for subdomains
location ~ ^/([^/?&:'"]+)/http-bind {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /http-bind;
}
# websockets for subdomains
location ~ ^/([^/?&:'"]+)/xmpp-websocket {
set $subdomain "$1.";
set $subdir "$1/";
set $prefix "$1";
rewrite ^/(.*)$ /xmpp-websocket;
}
2022-02-03 03:00:20 +01:00
2022-02-13 16:40:34 +01:00
# Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
2022-02-03 03:00:20 +01:00
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}