Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.58 KB | None | 0 0
  1. fastcgi_cache_path /usr/local/tmp/cache levels=1:2 keys_zone=NEXTCLOUD:100m inactive=60m;
  2. fastcgi_cache_key $scheme$request_method$host$request_uri;
  3. map $request_uri $skip_cache {
  4.      default 1;
  5.      ~*/thumbnail.php 0;
  6.      ~*/apps/galleryplus/ 0;
  7.      ~*/apps/gallery/ 0;
  8. }
  9. server {
  10.     listen 127.0.0.1:82;
  11.     server_name 127.0.0.1;
  12.     proxy_set_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  13.     proxy_set_header X-Content-Type-Options nosniff;
  14.     proxy_set_header X-Frame-Options "SAMEORIGIN";
  15.     proxy_set_header X-XSS-Protection "1; mode=block";
  16.     proxy_set_header X-Robots-Tag none;
  17.     proxy_set_header X-Download-Options noopen;
  18.     proxy_set_header X-Permitted-Cross-Domain-Policies none;
  19.     root /var/www/;
  20.     location = /robots.txt {
  21.         allow all;
  22.         log_not_found off;
  23.         access_log off;
  24.     }
  25.     location = /.well-known/carddav { return 301 $scheme://$host/nextcloud/remote.php/dav; }
  26.     location = /.well-known/caldav { return 301 $scheme://$host/nextcloud/remote.php/dav; }
  27.     location /.well-known/acme-challenge { }
  28.     location ^~ /nextcloud {
  29.     client_max_body_size 10G;
  30.     fastcgi_buffers 64 4K;
  31.     gzip on;
  32.     gzip_vary on;
  33.     gzip_types application/javascript application/x-javascript text/javascript text/xml text/css;
  34.     error_page 403 /nextcloud/core/templates/403.php;
  35.     error_page 404 /nextcloud/core/templates/404.php;
  36.     location /nextcloud {
  37.     rewrite ^ /nextcloud/index.php$uri;
  38.      }
  39.     location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  40.      deny all;
  41.      }
  42.     location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) {
  43.      deny all;
  44.     }
  45.     location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
  46.     fastcgi_split_path_info ^(.+\.php)(/.*)$;
  47.     include fastcgi_params;
  48.     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  49.     fastcgi_param PATH_INFO $fastcgi_path_info;
  50.     #fastcgi_param HTTPS on;
  51.     fastcgi_pass php-handler;
  52.     fastcgi_cache_bypass $skip_cache;
  53.     fastcgi_no_cache $skip_cache;
  54.     fastcgi_cache NEXTCLOUD;
  55.     fastcgi_cache_valid  60m;
  56.     fastcgi_cache_methods GET HEAD;
  57.     fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
  58.     fastcgi_param front_controller_active true;
  59.     fastcgi_intercept_errors on;
  60.     fastcgi_read_timeout 300;
  61.     fastcgi_send_timeout 300;
  62.     fastcgi_connect_timeout 300;  
  63.     fastcgi_param PHP_VALUE "upload_max_filesize = 10G
  64.                 post_max_size = 10G
  65.                 max_execution_time = 3600";            
  66.     fastcgi_param REMOTE_ADDR $http_x_real_ip;
  67.     }
  68.     location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
  69.      try_files $uri/ =404;
  70.      index index.php;
  71.     }
  72.     location ~* \.(?:css|js)$ {
  73.     try_files $uri /nextcloud/index.php$uri$is_args$args;
  74.     proxy_set_header Cache-Control "public, max-age=7200";
  75.     proxy_set_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  76.     proxy_set_header X-Content-Type-Options nosniff;
  77.     proxy_set_header X-Frame-Options "SAMEORIGIN";
  78.     proxy_set_header X-XSS-Protection "1; mode=block";
  79.     proxy_set_header X-Robots-Tag none;
  80.     proxy_set_header X-Download-Options noopen;
  81.     proxy_set_header X-Permitted-Cross-Domain-Policies none;
  82.     access_log off;
  83.     }
  84.     location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
  85.     try_files $uri /nextcloud/index.php$uri$is_args$args;
  86.     access_log off;
  87.         }
  88.     }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement