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

82 lines
1.9 KiB
Nginx Configuration File
Raw Normal View History

2020-04-10 05:21:33 +02:00
root __FINALPATH__/jitsi-meet-web;
2019-06-06 06:04:22 +02:00
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 {
alias __FINALPATH__/jitsi-meet-web/config.js;
2015-01-14 10:55:14 +01:00
}
2020-04-10 05:21:33 +02:00
location = /external_api.js {
alias __FINALPATH__/jitsi-meet-web/libs/external_api.min.js;
}
#ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias __FINALPATH__/jitsi-meet-web/$1/$2;
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 {
2020-01-20 03:18:36 +01:00
proxy_pass http://127.0.0.1:5290/http-bind;
2015-01-14 10:55:14 +01:00
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
2019-07-14 01:17:46 +02:00
# xmpp websockets
2020-04-10 05:21:33 +02:00
location = /xmpp-websocket {
proxy_pass http://127.0.0.1:5290/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";
2020-04-10 05:21:33 +02:00
proxy_set_header Host $http_host;
2019-07-14 01:17:46 +02:00
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$
{
set $subdomain "$1.";
set $subdir "$1/";
alias __FINALPATH__/jitsi-meet-web/config.js;
}
#Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
location ~ ^/([^/?&:'"]+)/(.*)$ {
set $subdomain "$1.";
set $subdir "$1/";
rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
}
# 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;
}