2
0

meet.conf 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool }}
  2. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  3. {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}}
  4. {{ $XMPP_DOMAIN := .Env.XMPP_DOMAIN | default "meet.jitsi" -}}
  5. {{ $XMPP_BOSH_URL_BASE := .Env.XMPP_BOSH_URL_BASE | default "http://xmpp.meet.jitsi:5280" -}}
  6. server_name _;
  7. client_max_body_size 0;
  8. root /usr/share/jitsi-meet;
  9. # ssi on with javascript for multidomain variables in config.js
  10. ssi on;
  11. ssi_types application/x-javascript application/javascript;
  12. index index.html index.htm;
  13. error_page 404 /static/404.html;
  14. # Security headers
  15. add_header X-Content-Type-Options nosniff;
  16. add_header X-XSS-Protection "1; mode=block";
  17. {{ if .Env.DEPLOYMENTINFO_SHARD }}
  18. add_header X-Jitsi-Shard {{ .Env.DEPLOYMENTINFO_SHARD }};
  19. {{ end }}
  20. # Opt out of FLoC (deprecated)
  21. add_header Permissions-Policy "interest-cohort=()";
  22. location = /config.js {
  23. alias /config/config.js;
  24. }
  25. location = /interface_config.js {
  26. alias /config/interface_config.js;
  27. }
  28. location = /external_api.js {
  29. alias /usr/share/jitsi-meet/libs/external_api.min.js;
  30. }
  31. {{ if $ENABLE_JAAS_COMPONENTS }}
  32. location = /_api/room-info {
  33. proxy_pass {{ $XMPP_BOSH_URL_BASE }}/room-info?prefix=$prefix&$args;
  34. proxy_http_version 1.1;
  35. proxy_set_header X-Forwarded-For $remote_addr;
  36. proxy_set_header Host $http_host;
  37. }
  38. {{ end }}
  39. # ensure all static content can always be found first
  40. location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$ {
  41. add_header 'Access-Control-Allow-Origin' '*';
  42. alias /usr/share/jitsi-meet/$1/$2;
  43. # cache all versioned files
  44. if ($arg_v) {
  45. expires 1y;
  46. }
  47. }
  48. {{ if $ENABLE_COLIBRI_WEBSOCKET }}
  49. # colibri (JVB) websockets
  50. location ~ ^/colibri-ws/([a-zA-Z0-9-\._]+)/(.*) {
  51. tcp_nodelay on;
  52. proxy_http_version 1.1;
  53. proxy_set_header Upgrade $http_upgrade;
  54. proxy_set_header Connection $connection_upgrade;
  55. proxy_pass http://$1:9090/colibri-ws/$1/$2$is_args$args;
  56. }
  57. {{ end }}
  58. # BOSH
  59. location = /http-bind {
  60. proxy_set_header X-Forwarded-For $remote_addr;
  61. proxy_set_header Host {{ $XMPP_DOMAIN }};
  62. proxy_pass {{ $XMPP_BOSH_URL_BASE }}/http-bind;
  63. }
  64. {{ if $ENABLE_XMPP_WEBSOCKET }}
  65. # xmpp websockets
  66. location = /xmpp-websocket {
  67. tcp_nodelay on;
  68. proxy_http_version 1.1;
  69. proxy_set_header Connection $connection_upgrade;
  70. proxy_set_header Upgrade $http_upgrade;
  71. proxy_set_header Host {{ $XMPP_DOMAIN }};
  72. proxy_set_header X-Forwarded-For $remote_addr;
  73. proxy_pass {{ $XMPP_BOSH_URL_BASE }}/xmpp-websocket;
  74. }
  75. {{ end }}
  76. {{ if .Env.ETHERPAD_URL_BASE }}
  77. # Etherpad-lite
  78. location ^~ /etherpad/ {
  79. proxy_buffering off;
  80. proxy_cache_bypass $http_upgrade;
  81. proxy_http_version 1.1;
  82. proxy_set_header Upgrade $http_upgrade;
  83. proxy_set_header Connection "upgrade";
  84. proxy_set_header X-Forwarded-For $remote_addr;
  85. proxy_pass {{ .Env.ETHERPAD_URL_BASE }}/;
  86. }
  87. {{ end }}
  88. location ~ ^/([^/?&:'"]+)$ {
  89. try_files $uri @root_path;
  90. }
  91. location @root_path {
  92. rewrite ^/(.*)$ / break;
  93. }
  94. {{ if $ENABLE_SUBDOMAINS }}
  95. location ~ ^/([^/?&:'"]+)/config.js$ {
  96. set $subdomain "$1.";
  97. set $subdir "$1/";
  98. alias /config/config.js;
  99. }
  100. # BOSH for subdomains
  101. location ~ ^/([^/?&:'"]+)/http-bind {
  102. set $subdomain "$1.";
  103. set $subdir "$1/";
  104. set $prefix "$1";
  105. rewrite ^/(.*)$ /http-bind;
  106. }
  107. {{ if $ENABLE_XMPP_WEBSOCKET }}
  108. # websockets for subdomains
  109. location ~ ^/([^/?&:'"]+)/xmpp-websocket {
  110. set $subdomain "$1.";
  111. set $subdir "$1/";
  112. set $prefix "$1";
  113. rewrite ^/(.*)$ /xmpp-websocket;
  114. }
  115. {{ end }}
  116. {{ if $ENABLE_JAAS_COMPONENTS }}
  117. location ~ ^/([^/?&:'"]+)/_api/room-info {
  118. set $subdomain "$1.";
  119. set $subdir "$1/";
  120. set $prefix "$1";
  121. rewrite ^/(.*)$ /_api/room-info;
  122. }
  123. {{ end }}
  124. # Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
  125. location ~ ^/([^/?&:'"]+)/(.*)$ {
  126. set $subdomain "$1.";
  127. set $subdir "$1/";
  128. rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
  129. }
  130. {{ end }}