Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name nextcloud.niklasrosenstein.com;
  4. server_tokens off;
  5. return 301 https://$server_name$request_uri;
  6. }
  7.  
  8. server {
  9. ssl on;
  10. listen 443 ssl;
  11. server_name nextcloud.niklasrosenstein.com;
  12. client_max_body_size 10G;
  13.  
  14. add_header X-Content-Type-Options nosniff;
  15. add_header X-Frame-Options "SAMEORIGIN";
  16. add_header X-XSS-Protection "1; mode=block";
  17. add_header X-Robots-Tag none;
  18. add_header X-Download-Options noopen;
  19. add_header X-Permitted-Cross-Domain-Policies none;
  20.  
  21. root /home/niklas/nextcloud/nextcloud;
  22.  
  23. #fastcgi_buffers 64 4K;
  24. gzip off;
  25.  
  26. location = /robots.txt {
  27. allow all;
  28. log_not_found off;
  29. access_log off;
  30. }
  31.  
  32. location = /.well-known/carddav {
  33. return 301 $scheme://$host/remote.php/dav;
  34. }
  35.  
  36. location = /.well-known/caldav {
  37. return 301 $scheme://$host/remote.php/dav;
  38. }
  39.  
  40. location / {
  41. rewrite ^ /index.php?$uri;
  42. }
  43.  
  44. location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  45. deny all;
  46. }
  47.  
  48. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  49. deny all;
  50. }
  51.  
  52. location ~ ^/(?:updater|ocs-provider)(?:$|/) {
  53. try_files $uri/ =404;
  54. index index.php;
  55. }
  56.  
  57. location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
  58. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  59. include fastcgi_params;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_param PATH_INFO $fastcgi_path_info;
  62. fastcgi_param HTTPS on;
  63. #Avoid sending the security headers twice
  64. fastcgi_param modHeadersAvailable true;
  65. fastcgi_param front_controller_active true;
  66. fastcgi_pass unix:/home/niklas/nextcloud/php-fpm/sock;
  67. fastcgi_intercept_errors on;
  68. #fastcgi_request_buffering off;
  69. }
  70.  
  71. # Adding the cache control header for js and css files
  72. # Make sure it is BELOW the PHP block
  73. location ~* \.(?:css|js|woff|svg|gif)$ {
  74. try_files $uri /index.php$uri$is_args$args;
  75. add_header Cache-Control "public, max-age=7200";
  76. # Add headers to serve security related headers (It is intended to
  77. # have those duplicated to the ones above)
  78. # Before enabling Strict-Transport-Security headers please read into
  79. # this topic first.
  80. # add_header Strict-Transport-Security "max-age=15768000;
  81. # includeSubDomains; preload;";
  82. add_header X-Content-Type-Options nosniff;
  83. add_header X-Frame-Options "SAMEORIGIN";
  84. add_header X-XSS-Protection "1; mode=block";
  85. add_header X-Robots-Tag none;
  86. add_header X-Download-Options noopen;
  87. add_header X-Permitted-Cross-Domain-Policies none;
  88. # Optional: Don't log access to assets
  89. access_log off;
  90. }
  91.  
  92. location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  93. try_files $uri /index.php$uri$is_args$args;
  94. # Optional: Don't log access to other assets
  95. access_log off;
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement