meet.conf 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool }}
  2. {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
  3. {{ $WS_SERVER_ID := .Env.JVB_WS_SERVER_ID | default .Env.JVB_WS_SERVER_ID_FALLBACK -}}
  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. }
  36. {{ if $ENABLE_COLIBRI_WEBSOCKET }}
  37. # colibri (JVB) websockets
  38. location ~ ^/colibri-ws/{{ $WS_SERVER_ID }}/(.*) {
  39. proxy_pass http://{{ $WS_SERVER_ID }}:9090/colibri-ws/{{ $WS_SERVER_ID }}/$1$is_args$args;
  40. proxy_http_version 1.1;
  41. proxy_set_header Upgrade $http_upgrade;
  42. proxy_set_header Connection "upgrade";
  43. tcp_nodelay on;
  44. }
  45. {{ end }}
  46. # BOSH
  47. location = /http-bind {
  48. proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/http-bind;
  49. proxy_set_header X-Forwarded-For $remote_addr;
  50. proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
  51. }
  52. {{ if $ENABLE_XMPP_WEBSOCKET }}
  53. # xmpp websockets
  54. location = /xmpp-websocket {
  55. proxy_pass {{ .Env.XMPP_BOSH_URL_BASE }}/xmpp-websocket;
  56. proxy_http_version 1.1;
  57. proxy_set_header Connection "upgrade";
  58. proxy_set_header Upgrade $http_upgrade;
  59. proxy_set_header Host {{ .Env.XMPP_DOMAIN }};
  60. proxy_set_header X-Forwarded-For $remote_addr;
  61. tcp_nodelay on;
  62. }
  63. {{ end }}
  64. location ~ ^/([^/?&:'"]+)$ {
  65. try_files $uri @root_path;
  66. }
  67. location @root_path {
  68. rewrite ^/(.*)$ / break;
  69. }
  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 }}