meet.conf 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool }}
  2. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  3. server_name _;
  4. client_max_body_size 0;
  5. root /usr/share/jitsi-meet;
  6. # ssi on with javascript for multidomain variables in config.js
  7. ssi on;
  8. ssi_types application/x-javascript application/javascript;
  9. index index.html index.htm;
  10. error_page 404 /static/404.html;
  11. # Security headers
  12. add_header X-Content-Type-Options nosniff;
  13. add_header X-XSS-Protection "1; mode=block";
  14. {{ if .Env.DEPLOYMENTINFO_SHARD }}
  15. add_header X-Jitsi-Shard {{ .Env.DEPLOYMENTINFO_SHARD }};
  16. {{ end }}
  17. {{ if not (.Env.ENABLE_FLOC | default "0" | toBool) }}
  18. add_header Permissions-Policy "interest-cohort=()";
  19. {{ end }}
  20. location = /config.js {
  21. alias /config/config.js;
  22. }
  23. location = /interface_config.js {
  24. alias /config/interface_config.js;
  25. }
  26. location = /external_api.js {
  27. alias /usr/share/jitsi-meet/libs/external_api.min.js;
  28. }
  29. # ensure all static content can always be found first
  30. location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
  31. {
  32. add_header 'Access-Control-Allow-Origin' '*';
  33. alias /usr/share/jitsi-meet/$1/$2;
  34. # cache all versioned files
  35. if ($arg_v) {
  36. expires 1y;
  37. }
  38. }
  39. {{ if $ENABLE_COLIBRI_WEBSOCKET }}
  40. # colibri (JVB) websockets
  41. location ~ ^/colibri-ws/([a-zA-Z0-9-\.]+)/(.*) {
  42. proxy_pass http://$1:9090/colibri-ws/$1/$2$is_args$args;
  43. proxy_http_version 1.1;
  44. proxy_set_header Upgrade $http_upgrade;
  45. proxy_set_header Connection "upgrade";
  46. tcp_nodelay on;
  47. }
  48. {{ end }}
  49. # BOSH
  50. location = /http-bind {
  51. proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/http-bind;
  52. proxy_set_header X-Forwarded-For $remote_addr;
  53. proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
  54. }
  55. {{ if $ENABLE_XMPP_WEBSOCKET }}
  56. # xmpp websockets
  57. location = /xmpp-websocket {
  58. proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/xmpp-websocket;
  59. proxy_http_version 1.1;
  60. proxy_set_header Connection "upgrade";
  61. proxy_set_header Upgrade $http_upgrade;
  62. proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
  63. proxy_set_header X-Forwarded-For $remote_addr;
  64. tcp_nodelay on;
  65. }
  66. {{ end }}
  67. location ~ ^/([^/?&:'"]+)$ {
  68. try_files $uri @root_path;
  69. }
  70. location @root_path {
  71. rewrite ^/(.*)$ / break;
  72. }
  73. {{ if .Env.ETHERPAD_URL_BASE }}
  74. # Etherpad-lite
  75. location /etherpad/ {
  76. proxy_http_version 1.1;
  77. proxy_set_header Upgrade $http_upgrade;
  78. proxy_set_header Connection 'upgrade';
  79. proxy_cache_bypass $http_upgrade;
  80. proxy_pass {{ .Env.ETHERPAD_URL_BASE }}/;
  81. proxy_set_header X-Forwarded-For $remote_addr;
  82. proxy_buffering off;
  83. }
  84. {{ end }}