meet.conf 3.7 KB

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