clsi-nginx.conf 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # keep in sync with clsi-startup.sh files
  2. # keep in sync with clsi/nginx.conf
  3. # Changes to the above:
  4. # - added debug header
  5. # - remove CORS rules, Server-CE/Server-Pro runs behind a single origin
  6. # - change /output path to /var/lib/sharelatex/data/output
  7. server {
  8. # Extra header for debugging.
  9. add_header 'X-Served-By' 'clsi-nginx' always;
  10. # Security-Headers
  11. add_header 'X-Content-Type-Options' 'nosniff' always;
  12. add_header 'X-Download-Options' 'noopen' always;
  13. add_header 'X-Frame-Options' 'SAMEORIGIN' always;
  14. add_header 'X-XSS-Protection' '1; mode=block' always;
  15. listen 8080;
  16. server_name clsi-nginx;
  17. server_tokens off;
  18. access_log off;
  19. # Ignore symlinks possibly created by users
  20. disable_symlinks on;
  21. # enable compression for tex auxiliary files, but not for pdf files
  22. gzip on;
  23. gzip_types text/plain;
  24. gzip_proxied any;
  25. types {
  26. text/plain log blg aux stdout stderr;
  27. application/pdf pdf;
  28. }
  29. # handle output files for specific users
  30. location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
  31. alias /var/lib/sharelatex/data/output/$1-$2/generated-files/$3/output.$4;
  32. }
  33. # handle output files for anonymous users
  34. location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
  35. alias /var/lib/sharelatex/data/output/$1/generated-files/$2/output.$3;
  36. }
  37. # PDF range for specific users
  38. location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
  39. # Cache for one day
  40. expires 1d;
  41. alias /var/lib/sharelatex/data/output/$1-$2/content/$3;
  42. }
  43. # PDF range for anonymous users
  44. location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
  45. # Cache for one day
  46. expires 1d;
  47. alias /var/lib/sharelatex/data/output/$1/content/$2;
  48. }
  49. }