overleaf.conf 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. server {
  2. listen 80;
  3. server_name _; # Catch all, see http://nginx.org/en/docs/http/server_names.html
  4. root /overleaf/services/web/public/;
  5. # block external access to prometheus /metrics
  6. location /metrics {
  7. internal;
  8. }
  9. location / {
  10. proxy_pass http://127.0.0.1:4000;
  11. proxy_http_version 1.1;
  12. proxy_set_header Upgrade $http_upgrade;
  13. proxy_set_header Connection "upgrade";
  14. proxy_set_header Host $host;
  15. proxy_set_header X-Forwarded-Host $host;
  16. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  17. proxy_read_timeout 10m;
  18. proxy_send_timeout 10m;
  19. }
  20. location /socket.io {
  21. proxy_pass http://127.0.0.1:3026;
  22. proxy_http_version 1.1;
  23. proxy_set_header Upgrade $http_upgrade;
  24. proxy_set_header Connection "upgrade";
  25. proxy_set_header Host $host;
  26. proxy_set_header X-Forwarded-Host $host;
  27. proxy_set_header X-Forwarded-Proto $scheme;
  28. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  29. proxy_read_timeout 10m;
  30. proxy_send_timeout 10m;
  31. }
  32. location /stylesheets {
  33. expires 1y;
  34. }
  35. location /minjs {
  36. expires 1y;
  37. }
  38. location /img {
  39. expires 1y;
  40. }
  41. # handle output files for specific users
  42. location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
  43. proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
  44. proxy_http_version 1.1;
  45. }
  46. # handle output files for anonymous users
  47. location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
  48. proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
  49. proxy_http_version 1.1;
  50. }
  51. # PDF range for specific users
  52. location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
  53. proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
  54. proxy_http_version 1.1;
  55. }
  56. # PDF range for anonymous users
  57. location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
  58. proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
  59. proxy_http_version 1.1;
  60. }
  61. # Load any extra configuration for this vhost
  62. include /etc/nginx/vhost-extras/overleaf/*.conf;
  63. }