You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
3.6 KiB
148 lines
3.6 KiB
{{ $XMPP_BOSH_URL_BASE := .Env.XMPP_BOSH_URL_BASE | default "http://xmpp.meet.jitsi:5280" -}}
|
|
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "false" | toBool -}}
|
|
|
|
server_name _;
|
|
|
|
client_max_body_size 0;
|
|
|
|
root /usr/share/jitsi-meet;
|
|
index index.html;
|
|
error_page 404 /static/404.html;
|
|
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr;
|
|
|
|
|
|
set $prefix "";
|
|
|
|
ssi on;
|
|
ssi_types application/x-javascript application/javascript;
|
|
|
|
location = /config.js {
|
|
alias /config/config.js;
|
|
}
|
|
location = /interface_config.js {
|
|
alias /config/interface_config.js;
|
|
}
|
|
|
|
location = /external_api.js {
|
|
alias /usr/share/jitsi-meet/libs/external_api.min.js;
|
|
}
|
|
|
|
{{ if .Env.ENABLE_BOSH_PROXY }}
|
|
location = /http-bind {
|
|
proxy_pass {{ $XMPP_BOSH_URL_BASE }}/http-bind;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
}
|
|
{{ if .Env.ENABLE_WEBSOCKETS }}
|
|
location = /xmpp-websocket {
|
|
proxy_pass {{ $XMPP_BOSH_URL_BASE }}/xmpp-websocket;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
}
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ if .Env.ENABLE_BOSH_REDIRECT }}
|
|
location = /http-bind {
|
|
return 404;
|
|
}
|
|
{{ if .Env.ENABLE_WEBSOCKETS }}
|
|
location = /xmpp-websocket {
|
|
return 404;
|
|
}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if .Env.ETHERPAD_URL_BASE }}
|
|
# Etherpad-lite
|
|
location = /etherpad/ {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
proxy_pass {{ .Env.ETHERPAD_URL_BASE }}/;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_buffering off;
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
}
|
|
{{ end }}
|
|
|
|
location ~ ^/([^/?&:'"]+)$ {
|
|
try_files $uri @root_path;
|
|
}
|
|
|
|
location @root_path {
|
|
rewrite ^/(.*)$ / break;
|
|
}
|
|
|
|
location = / {
|
|
ssi on;
|
|
}
|
|
|
|
{{ if $ENABLE_SUBDOMAINS }}
|
|
location ~ ^/([^/?&:'"]+)/config.js$
|
|
{
|
|
set $subdomain "$1.";
|
|
set $subdir "$1/";
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
|
|
|
|
alias /config/config.js;
|
|
}
|
|
|
|
location ~ ^/([^/?&:'"]+)/interface_config.js$
|
|
{
|
|
set $subdomain "$1.";
|
|
set $subdir "$1/";
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
|
|
|
|
alias /config/interface_config.js;
|
|
}
|
|
|
|
location ~ ^/([^/?&:'"]+)/libs/lib-jitsi-meet.min.js
|
|
{
|
|
set $subdomain "$1.";
|
|
set $subdir "$1/";
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Expose-Headers' "Content-Type, X-Jitsi-Region, X-Jitsi-Shard, X-Proxy-Region";
|
|
alias /usr/share/jitsi-meet/libs/lib-jitsi-meet.min.js;
|
|
}
|
|
|
|
location ~ ^/([^/?&:'"]+)/external_api.js {
|
|
alias /usr/share/jitsi-meet/libs/external_api.min.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;
|
|
# }
|
|
|
|
{{ end }} |