meet.conf 3.6 KB

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