JustAnotherPony

asd

Mar 8th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. upstream php-handler {
  2. server 127.0.0.1:9000;
  3. #server unix:/var/run/php/php7.0-fpm.sock;
  4. }
  5.  
  6. server {
  7. listen 80;
  8. server_name cloud.example.com;
  9. }
  10.  
  11. server {
  12. # Add headers to serve security related headers
  13. # Before enabling Strict-Transport-Security headers please read into this
  14. # topic first.
  15. #add_header Strict-Transport-Security "max-age=15768000;
  16. # includeSubDomains; preload;";
  17. add_header X-Content-Type-Options nosniff;
  18. add_header X-Frame-Options "SAMEORIGIN";
  19. add_header X-XSS-Protection "1; mode=block";
  20. add_header X-Robots-Tag none;
  21. add_header X-Download-Options noopen;
  22. add_header X-Permitted-Cross-Domain-Policies none;
  23.  
  24. # Path to the root of your installation
  25. root /home/blackjack/another-pony/nextcloud/;
  26.  
  27. location = /robots.txt {
  28. allow all;
  29. log_not_found off;
  30. access_log off;
  31. }
  32.  
  33. # The following 2 rules are only needed for the user_webfinger app.
  34. # Uncomment it if you're planning to use this app.
  35. # rewrite ^/.well-known/host-meta /nextcloud/public.php?service=host-meta
  36. # last;
  37. #rewrite ^/.well-known/host-meta.json
  38. # /nextcloud/public.php?service=host-meta-json last;
  39.  
  40. location = /.well-known/carddav {
  41. return 301 $scheme://$host/nextcloud/remote.php/dav;
  42. }
  43. location = /.well-known/caldav {
  44. return 301 $scheme://$host/nextcloud/remote.php/dav;
  45. }
  46.  
  47. location /.well-known/acme-challenge { }
  48.  
  49. location ^~ /nextcloud {
  50.  
  51. # set max upload size
  52. client_max_body_size 512M;
  53. fastcgi_buffers 64 4K;
  54.  
  55. # Disable gzip to avoid the removal of the ETag header
  56. gzip off;
  57.  
  58. # Uncomment if your server is build with the ngx_pagespeed module
  59. # This module is currently not supported.
  60. #pagespeed off;
  61.  
  62. error_page 403 /nextcloud/core/templates/403.php;
  63. error_page 404 /nextcloud/core/templates/404.php;
  64.  
  65. location /nextcloud {
  66. rewrite ^ /nextcloud/index.php$uri;
  67. }
  68.  
  69. location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  70. deny all;
  71. }
  72. location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) {
  73. deny all;
  74. }
  75.  
  76. location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
  77. include fastcgi_params;
  78. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  79. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  80. fastcgi_param PATH_INFO $fastcgi_path_info;
  81. #Avoid sending the security headers twice
  82. fastcgi_param modHeadersAvailable true;
  83. fastcgi_param front_controller_active true;
  84. fastcgi_pass php-handler;
  85. fastcgi_intercept_errors on;
  86. fastcgi_request_buffering off;
  87. }
  88.  
  89. location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
  90. try_files $uri/ =404;
  91. index index.php;
  92. }
  93.  
  94. # Adding the cache control header for js and css files
  95. # Make sure it is BELOW the PHP block
  96. location ~* \.(?:css|js|woff|svg|gif)$ {
  97. try_files $uri /nextcloud/index.php$uri$is_args$args;
  98. add_header Cache-Control "public, max-age=7200";
  99. # Add headers to serve security related headers (It is intended
  100. # to have those duplicated to the ones above)
  101. # Before enabling Strict-Transport-Security headers please read
  102. # into this topic first.
  103. # add_header Strict-Transport-Security "max-age=15768000;
  104. # includeSubDomains; preload;";
  105. add_header X-Content-Type-Options nosniff;
  106. add_header X-Frame-Options "SAMEORIGIN";
  107. add_header X-XSS-Protection "1; mode=block";
  108. add_header X-Robots-Tag none;
  109. add_header X-Download-Options noopen;
  110. add_header X-Permitted-Cross-Domain-Policies none;
  111. # Optional: Don't log access to assets
  112. access_log off;
  113. }
  114.  
  115. location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
  116. try_files $uri /nextcloud/index.php$uri$is_args$args;
  117. # Optional: Don't log access to other assets
  118. access_log off;
  119. }
  120. }
  121. }
Add Comment
Please, Sign In to add comment