Artim

jitsi nginx config

May 4th, 2020
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server_names_hash_bucket_size 64;
  2.  
  3. server {
  4. server_name jitsi.domain.de ;
  5. root /usr/share/jitsi-meet;
  6.  
  7. index index.html index.htm;
  8. error_page 404 /static/404.html;
  9.  
  10. # ssi on with javascript for multidomain variables in config.js
  11. ssi on;
  12. ssi_types application/x-javascript application/javascript;
  13.  
  14. gzip on;
  15. gzip_types text/plain text/css application/javascript application/json;
  16. gzip_vary on;
  17.  
  18. brotli on;
  19. brotli_types text/plain text/css application/javascript application/json;
  20.  
  21. location = /config.js {
  22. alias /etc/jitsi/meet/jitsi.domain.de-config.js;
  23. }
  24.  
  25. location = /external_api.js {
  26. alias /usr/share/jitsi-meet/libs/external_api.min.js;
  27. }
  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. add_header 'Access-Control-Allow-Origin' '*';
  32. alias /usr/share/jitsi-meet/$1/$2;
  33. }
  34.  
  35. # BOSH, Bidirectional-streams Over Synchronous HTTP
  36. # https://en.wikipedia.org/wiki/BOSH_(protocol)
  37. location = /http-bind {
  38. proxy_pass http://localhost:5280/http-bind;
  39. proxy_set_header X-Forwarded-For $remote_addr;
  40. proxy_set_header Host $http_host;
  41. }
  42.  
  43. # xmpp websockets
  44. location = /xmpp-websocket {
  45. proxy_pass http://localhost:5280/xmpp-websocket?prefix=$prefix&$args;
  46. proxy_http_version 1.1;
  47. proxy_set_header Upgrade $http_upgrade;
  48. proxy_set_header Connection "Upgrade";
  49. proxy_set_header Host $host;
  50. tcp_nodelay on;
  51. }
  52.  
  53. location ~ ^/([^/?&:'"]+)$ {
  54. try_files $uri @root_path;
  55. }
  56.  
  57. location @root_path {
  58. rewrite ^/(.*)$ / break;
  59. }
  60.  
  61. location ~ ^/([^/?&:'"]+)/config.js$ {
  62. set $subdomain "$1.";
  63. set $subdir "$1/";
  64.  
  65. alias /etc/jitsi/meet/jitsi-meet.example.com-config.js;
  66. }
  67.  
  68. #Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to /
  69. location ~ ^/([^/?&:'"]+)/(.*)$ {
  70. set $subdomain "$1.";
  71. set $subdir "$1/";
  72. rewrite ^/([^/?&:'"]+)/(.*)$ /$2;
  73. }
  74.  
  75. # BOSH for subdomains
  76. location ~ ^/([^/?&:'"]+)/http-bind {
  77. set $subdomain "$1.";
  78. set $subdir "$1/";
  79. set $prefix "$1";
  80.  
  81. rewrite ^/(.*)$ /http-bind;
  82. }
  83.  
  84. # websockets for subdomains
  85. location ~ ^/([^/?&:'"]+)/xmpp-websocket {
  86. set $subdomain "$1.";
  87. set $subdir "$1/";
  88. set $prefix "$1";
  89.  
  90. rewrite ^/(.*)$ /xmpp-websocket;
  91. }
  92.  
  93.  
  94. listen 443 ssl http2;
  95. listen [::]:443 ssl http2;
  96. ssl_certificate /etc/ssl/certs/jitsi.domain.de.fullchain.pem;
  97. ssl_certificate_key /etc/ssl/private/jitsi.domain.de.private.pem;
  98. }
  99.  
  100. server {
  101. listen 80;
  102. listen [::]:80;
  103. server_name jitsi.domain.de;
  104.  
  105. location / {
  106. return 301 https://$host$request_uri;
  107. }
  108. }
RAW Paste Data