default.conf 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. server {
  2. listen 80;
  3. server_name _;
  4. root /usr/share/nginx/html;
  5. index index.html;
  6. location = /oo-preview.html {
  7. if_modified_since off;
  8. etag off;
  9. add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
  10. add_header Pragma "no-cache" always;
  11. add_header Expires "0" always;
  12. }
  13. location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot)$ {
  14. expires 30d;
  15. add_header Cache-Control "public, immutable";
  16. }
  17. location /pdfs/ {
  18. alias /data/pdfs/;
  19. add_header Content-Disposition "inline";
  20. add_header X-Content-Type-Options "nosniff";
  21. add_header Cache-Control "no-store";
  22. }
  23. location /excels/ {
  24. alias /data/excels/;
  25. add_header X-Frame-Options "SAMEORIGIN";
  26. add_header Cache-Control "no-store";
  27. }
  28. location /words/ {
  29. alias /data/words/;
  30. add_header X-Frame-Options "SAMEORIGIN";
  31. add_header Cache-Control "no-store";
  32. }
  33. location /raw/excels/ {
  34. alias /data/raw_excels/;
  35. add_header Cache-Control "no-store";
  36. }
  37. location /raw/words/ {
  38. alias /data/raw_words/;
  39. add_header Cache-Control "no-store";
  40. }
  41. location /raw/files/ {
  42. alias /data/uploads/;
  43. add_header Cache-Control "no-store";
  44. }
  45. location ^~ /onlyoffice/ {
  46. proxy_pass http://onlyoffice:80/;
  47. proxy_http_version 1.1;
  48. proxy_set_header Host $http_host;
  49. proxy_set_header X-Forwarded-Host $http_host;
  50. proxy_set_header X-Forwarded-Port $server_port;
  51. proxy_set_header X-Forwarded-Proto $scheme;
  52. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  53. proxy_set_header Upgrade $http_upgrade;
  54. proxy_set_header Connection "upgrade";
  55. proxy_set_header X-Real-IP $remote_addr;
  56. proxy_read_timeout 3600;
  57. proxy_send_timeout 3600;
  58. proxy_buffering off;
  59. }
  60. location ^~ /cache/ {
  61. proxy_pass http://onlyoffice:80/cache/;
  62. proxy_http_version 1.1;
  63. proxy_set_header Host $http_host;
  64. proxy_set_header X-Forwarded-Host $http_host;
  65. proxy_set_header X-Forwarded-Port $server_port;
  66. proxy_set_header X-Forwarded-Proto $scheme;
  67. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  68. proxy_set_header X-Real-IP $remote_addr;
  69. proxy_read_timeout 3600;
  70. proxy_send_timeout 3600;
  71. proxy_buffering off;
  72. }
  73. location / {
  74. try_files $uri $uri/ $uri.html =404;
  75. }
  76. error_page 404 /404.html;
  77. }