|
@@ -1,44 +1,66 @@
|
|
|
|
+{{ $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 _;
|
|
server_name _;
|
|
|
|
|
|
client_max_body_size 0;
|
|
client_max_body_size 0;
|
|
|
|
|
|
root /usr/share/jitsi-meet;
|
|
root /usr/share/jitsi-meet;
|
|
-index index.html
|
|
|
|
|
|
+index index.html;
|
|
error_page 404 /static/404.html;
|
|
error_page 404 /static/404.html;
|
|
|
|
|
|
-location ~ ^/([a-zA-Z0-9=\?]+)$ {
|
|
|
|
- rewrite ^/(.*)$ / break;
|
|
|
|
-}
|
|
|
|
|
|
+access_log /dev/stdout;
|
|
|
|
+error_log /dev/stderr;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+set $prefix "";
|
|
|
|
|
|
ssi on;
|
|
ssi on;
|
|
ssi_types application/x-javascript application/javascript;
|
|
ssi_types application/x-javascript application/javascript;
|
|
|
|
|
|
-location /config.js {
|
|
|
|
|
|
+location = /config.js {
|
|
alias /config/config.js;
|
|
alias /config/config.js;
|
|
}
|
|
}
|
|
-
|
|
|
|
-location /interface_config.js {
|
|
|
|
|
|
+location = /interface_config.js {
|
|
alias /config/interface_config.js;
|
|
alias /config/interface_config.js;
|
|
}
|
|
}
|
|
|
|
|
|
-location /external_api.js {
|
|
|
|
|
|
+location = /external_api.js {
|
|
alias /usr/share/jitsi-meet/libs/external_api.min.js;
|
|
alias /usr/share/jitsi-meet/libs/external_api.min.js;
|
|
}
|
|
}
|
|
|
|
|
|
-location / {
|
|
|
|
- ssi on;
|
|
|
|
|
|
+{{ 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 }};
|
|
}
|
|
}
|
|
-
|
|
|
|
-# BOSH
|
|
|
|
-location /http-bind {
|
|
|
|
- proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/http-bind;
|
|
|
|
|
|
+{{ 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 X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
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 }}
|
|
{{ if .Env.ETHERPAD_URL_BASE }}
|
|
# Etherpad-lite
|
|
# Etherpad-lite
|
|
-location /etherpad/ {
|
|
|
|
|
|
+location = /etherpad/ {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Connection 'upgrade';
|
|
@@ -51,3 +73,76 @@ location /etherpad/ {
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
|
|
}
|
|
}
|
|
{{ end }}
|
|
{{ 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 }}
|