meet.conf 3.7 KB

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