site.nextcloud.custom 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. location ^~ /nextcloud {
  2. location /nextcloud {
  3. rewrite ^ /nextcloud/index.php$uri;
  4. }
  5. location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  6. deny all;
  7. }
  8. location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) {
  9. deny all;
  10. }
  11. location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
  12. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  13. include fastcgi_params;
  14. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  15. fastcgi_param PATH_INFO $fastcgi_path_info;
  16. fastcgi_param HTTPS on;
  17. fastcgi_param modHeadersAvailable true;
  18. fastcgi_param front_controller_active true;
  19. fastcgi_pass phpfpm:9002;
  20. fastcgi_intercept_errors on;
  21. fastcgi_request_buffering off;
  22. client_max_body_size 0;
  23. fastcgi_read_timeout 1200;
  24. }
  25. location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
  26. try_files $uri/ =404;
  27. index index.php;
  28. }
  29. location ~ \.(?:css|js|woff|svg|gif)$ {
  30. try_files $uri /nextcloud/index.php$uri$is_args$args;
  31. add_header Cache-Control "public, max-age=15778463";
  32. add_header X-Content-Type-Options nosniff;
  33. add_header X-XSS-Protection "1; mode=block";
  34. add_header X-Robots-Tag none;
  35. add_header X-Download-Options noopen;
  36. add_header X-Permitted-Cross-Domain-Policies none;
  37. add_header X-Frame-Options "SAMEORIGIN";
  38. access_log off;
  39. }
  40. location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  41. try_files $uri /nextcloud/index.php$uri$is_args$args;
  42. access_log off;
  43. }
  44. }