Guest User

Untitled

a guest
Mar 8th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. server {
  2.  
  3. listen 443 ssl;
  4.  
  5. # Path to the root of your installation
  6. root /owncloud;
  7. # set max upload size
  8. client_max_body_size 10G;
  9. fastcgi_buffers 64 4K;
  10.  
  11. # Disable gzip to avoid the removal of the ETag header
  12. gzip off;
  13.  
  14. index index.php;
  15. error_page 403 /core/templates/403.php;
  16. error_page 404 /core/templates/404.php;
  17.  
  18. rewrite ^/.well-known/carddav /remote.php/carddav/ permanent;
  19. rewrite ^/.well-known/caldav /remote.php/caldav/ permanent;
  20.  
  21. location = /robots.txt {
  22. allow all;
  23. log_not_found off;
  24. access_log off;
  25. }
  26.  
  27. location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ {
  28. deny all;
  29. }
  30.  
  31. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  32. deny all;
  33. }
  34.  
  35. location / {
  36. rewrite ^/remote/(.*) /remote.php last;
  37. rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  38. try_files $uri $uri/ =404;
  39. }
  40.  
  41. location ~ \.php(?:$|/) {
  42. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  43. include fastcgi_params;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  45. fastcgi_param PATH_INFO $fastcgi_path_info;
  46. fastcgi_param HTTPS on;
  47. fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
  48. fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
  49. fastcgi_intercept_errors on;
  50. }
  51.  
  52. # Adding the cache control header for js and css files
  53. # Make sure it is BELOW the location ~ \.php(?:$|/) { block
  54. location ~* \.(?:css|js)$ {
  55. add_header Cache-Control "public, max-age=7200";
  56. # Add headers to serve security related headers
  57. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  58. add_header X-Content-Type-Options nosniff;
  59. add_header X-Frame-Options "SAMEORIGIN";
  60. add_header X-XSS-Protection "1; mode=block";
  61. add_header X-Robots-Tag none;
  62. add_header X-Download-Options noopen;
  63. add_header X-Permitted-Cross-Domain-Policies none;
  64. # Optional: Don't log access to assets
  65. access_log off;
  66. }
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment