Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fastcgi_cache_path /usr/local/tmp/cache levels=1:2 keys_zone=NEXTCLOUD:100m inactive=60m;
- fastcgi_cache_key $scheme$request_method$host$request_uri;
- map $request_uri $skip_cache {
- default 1;
- ~*/thumbnail.php 0;
- ~*/apps/galleryplus/ 0;
- ~*/apps/gallery/ 0;
- }
- server {
- listen 127.0.0.1:82;
- server_name 127.0.0.1;
- proxy_set_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
- proxy_set_header X-Content-Type-Options nosniff;
- proxy_set_header X-Frame-Options "SAMEORIGIN";
- proxy_set_header X-XSS-Protection "1; mode=block";
- proxy_set_header X-Robots-Tag none;
- proxy_set_header X-Download-Options noopen;
- proxy_set_header X-Permitted-Cross-Domain-Policies none;
- root /var/www/;
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location = /.well-known/carddav { return 301 $scheme://$host/nextcloud/remote.php/dav; }
- location = /.well-known/caldav { return 301 $scheme://$host/nextcloud/remote.php/dav; }
- location /.well-known/acme-challenge { }
- location ^~ /nextcloud {
- client_max_body_size 10G;
- fastcgi_buffers 64 4K;
- gzip on;
- gzip_vary on;
- gzip_types application/javascript application/x-javascript text/javascript text/xml text/css;
- error_page 403 /nextcloud/core/templates/403.php;
- error_page 404 /nextcloud/core/templates/404.php;
- location /nextcloud {
- rewrite ^ /nextcloud/index.php$uri;
- }
- location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
- deny all;
- }
- location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) {
- deny all;
- }
- location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- #fastcgi_param HTTPS on;
- fastcgi_pass php-handler;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache NEXTCLOUD;
- fastcgi_cache_valid 60m;
- fastcgi_cache_methods GET HEAD;
- fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
- fastcgi_param front_controller_active true;
- fastcgi_intercept_errors on;
- fastcgi_read_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_connect_timeout 300;
- fastcgi_param PHP_VALUE "upload_max_filesize = 10G
- post_max_size = 10G
- max_execution_time = 3600";
- fastcgi_param REMOTE_ADDR $http_x_real_ip;
- }
- location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
- try_files $uri/ =404;
- index index.php;
- }
- location ~* \.(?:css|js)$ {
- try_files $uri /nextcloud/index.php$uri$is_args$args;
- proxy_set_header Cache-Control "public, max-age=7200";
- proxy_set_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
- proxy_set_header X-Content-Type-Options nosniff;
- proxy_set_header X-Frame-Options "SAMEORIGIN";
- proxy_set_header X-XSS-Protection "1; mode=block";
- proxy_set_header X-Robots-Tag none;
- proxy_set_header X-Download-Options noopen;
- proxy_set_header X-Permitted-Cross-Domain-Policies none;
- access_log off;
- }
- location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
- try_files $uri /nextcloud/index.php$uri$is_args$args;
- access_log off;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement