site.nextcloud.custom 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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:9000;
  20. fastcgi_intercept_errors on;
  21. fastcgi_request_buffering off;
  22. client_max_body_size 10G;
  23. }
  24. location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
  25. try_files $uri/ =404;
  26. index index.php;
  27. }
  28. location ~ \.(?:css|js|woff|svg|gif)$ {
  29. try_files $uri /nextcloud/index.php$uri$is_args$args;
  30. add_header Cache-Control "public, max-age=15778463";
  31. add_header X-Content-Type-Options nosniff;
  32. add_header X-XSS-Protection "1; mode=block";
  33. add_header X-Robots-Tag none;
  34. add_header X-Download-Options noopen;
  35. add_header X-Permitted-Cross-Domain-Policies none;
  36. access_log off;
  37. }
  38. location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  39. try_files $uri /nextcloud/index.php$uri$is_args$args;
  40. access_log off;
  41. }
  42. }